Decimal places using TransferSpreadsheet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I use some code to create a query object via code (with another query as the
source). I then use TransferSpreadsheet to export this object as a .xls file.

This works fine, excpet for the decimals in my average field. I have used
the Fixed format in the underlying queries (set to 2 decimals), but this
format does not get transfered to the .xls file. The fixed format does reduce
the decimals down to 2 places when I open the query, but I notice when I
click in the average field, it shows several decimal places.

Is there a way to cut these values down to 2 places or some way to get the
Fixed format to output?

Thanks in advance,
Clint Herman
 
You need to format the data in the query that you export. Use a calculated
field instead of the real field, and use the Format function in that
calculated field to modify the format of the actual field's data to your
desired format.
 
Perfect! Thank you.

Ken Snell (MVP) said:
You need to format the data in the query that you export. Use a calculated
field instead of the real field, and use the Format function in that
calculated field to modify the format of the actual field's data to your
desired format.
 
Back
Top