Exporting Double without Decimals

  • Thread starter Thread starter FBxiii
  • Start date Start date
F

FBxiii

Hi.

I am trying to export a table to a text file using VBA (TransferText). The
file exports fine but the Double values in it have decimal places.

How do I export the table but without the decimals? The values are real
'doubles' as they are too big to be Long Integers. I need the text fields to
have the quote marks but the numerics to not.

I've tried Fix and Int in a query but these did not work either!

Thanks for any advice,
Steve.
 
You were on the right track. First use the Fix or Int functions to strip off
the decimals. The wrap that with the CStr() function to convert the number to
text.

Jerry
 
Hi,

You could format the decimal field and explicitly put quotes around the
text fields, then export with no text qualifier.

SELECT Format([DOUBLE_FIELD],"0") AS DOUBLE_FIELD_NO_DECIMAL, """" &
[TEXT_FIELD] & """" AS TEXT_FIELD_QUOTED
FROM tblData;

Clifford Bass
 
Thanks for the reply Jerry but I need the number to remain in the number
format once exported.

Cheers,
Steve.
 
Back
Top