|
The task is to convert house numbers that are stored in column with character
datatype to numeric value. We will use MS-Acces VAL()
function that recives char input and returnts Integer as output. Suppose that
we have 3 address coumns in table clients: city, street, house. Let's
try   VAL() function on house column and see the consequences.
SELECT VAL(house) AS house_number, house, street
FROM clients;
|
The query returns results like these:
| house_number | house | street |
| 51 | 51/2 | trolling str |
| 102 | 102 | akstrass |
| 0 | A203/58 | aufen str |
| 109 | 10 9-C | ahen str |
| 0 | N-8 Apt406 | ost klapen str |
| 780 | 780 n-19 | ukitgam 780/19 |
| 0 | -- | bolken str |
| 15 | 15-H Ap.4 | via domani |
Pay attention that character value "10 9-C" was converted to number
109.
On the other hand VAL() function was not able to convert string value "A203/58"
to any number but 0.
|