Force text field to numeric field?

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
 
J

Jeff Boyce

CInt([YourField]) in the query... (or CLng(), or CDbl(), or ...)

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
M

Marshall Barton

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top