from text to number

  • Thread starter Thread starter Annelie
  • Start date Start date
A

Annelie

I was able to convert in imported field, which has text and numbers, to all
numbers using
iif(isnumber([jobno]),jobno,0)
That formula left my job numbers alone and replaced any text with job no 0
But the field is still not being recognized as a number and I cannot make a
relationship between the jobs table and this jobno.
Any way I can do this?
Annelie
 
You could try wrapping a conversion function around your IIf statement. For
example, if it's supposed to be a Long Integer, try

CLng(iif(isnumber([jobno]),jobno,0))
 
Thank you,
It worked, the field is now being recognized as a number.
Annelie

Douglas J. Steele said:
You could try wrapping a conversion function around your IIf statement. For
example, if it's supposed to be a Long Integer, try

CLng(iif(isnumber([jobno]),jobno,0))

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Annelie said:
I was able to convert in imported field, which has text and numbers, to all
numbers using
iif(isnumber([jobno]),jobno,0)
That formula left my job numbers alone and replaced any text with job no 0
But the field is still not being recognized as a number and I cannot
make
a
relationship between the jobs table and this jobno.
Any way I can do this?
Annelie
 
I just wanted let everyone know, I typed in error isnumber, I used
"isnumeric", just in case anyone want to try the same thing and adding the
CLng in front did the trick.


Douglas J. Steele said:
You could try wrapping a conversion function around your IIf statement. For
example, if it's supposed to be a Long Integer, try

CLng(iif(isnumber([jobno]),jobno,0))

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Annelie said:
I was able to convert in imported field, which has text and numbers, to all
numbers using
iif(isnumber([jobno]),jobno,0)
That formula left my job numbers alone and replaced any text with job no 0
But the field is still not being recognized as a number and I cannot
make
a
relationship between the jobs table and this jobno.
Any way I can do this?
Annelie
 
Back
Top