Force text field to numeric field?

  • Thread starter Thread starter Cam
  • Start date Start date
C

Cam

Hello,

I have a query that will be exported to an Excel file. One of the field is a
text field with leading "000" zero and 6 numeric number. I can use
Right([field],6) to eliminate the first three zero, but at the same time How
can I force this field to be a numberic field instead text? Thanks
 
CInt([YourField]) in the query... (or CLng(), or CDbl(), or ...)

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Cam said:
I have a query that will be exported to an Excel file. One of the field is a
text field with leading "000" zero and 6 numeric number. I can use
Right([field],6) to eliminate the first three zero, but at the same time How
can I force this field to be a numberic field instead text?


Why fo you care, or is it just Excel that makes the
distinction? If it just so Excel treats it as a number, the
use a calculated field in the query. The calculations would
simply be:

CLng([field])

No need to worry about the leading zeros.
 
Back
Top