export to excel as a number field

  • Thread starter Thread starter JIM. H.
  • Start date Start date
J

JIM. H.

Hello,
I am using the following command to export a table to an
excel file. DoCmd.TransferSpreadsheet acExport,
8, "QuerySelect", fileNamePath, False, ""
QuerySelect is a select query I defined in Access.
There is one field which is a text type in the database
and I need to export that field as a number field into
excel (the field contains a float number with decimal
points)
How can I do that?
Thanks,
Jim.
 
In the query, use Val() around the text field to convert to number.
Val() cannot handle nulls, so you may need Nz() as well.

Example of the calculated query field:
MyNum: Val(Nz([MyText], 0))
 
Back
Top