Export to Excel

  • Thread starter Thread starter Sandy H
  • Start date Start date
S

Sandy H

Hi

I have a query that I export to excel via code. One of the fields in the
query is a text field that is formatted as mm/yyyy. When this query is
exported, the

value changes (to a five digit number commencing with 38).



Any clues?



Thanks in advance

Sandy
 
You sure it's a text field, and not a date field?

Dates are stored as 8 byte floating point numbers, where the integer portion
represents the date as the number of days relative to 30 Dec, 1899 (and the
decimal portion represents the time as a fraction of a day). Today (26 Mar,
2005) is 38437, so that would seem to be consistent with what you're seeing.

To get around this, try using the Format function in your query rather than
simply formatting the field.
 
It's definately not a date field however, I may have misrepresented the
problem. If I export the query directly, the mm/yyyy format appears
correctly but if I have a report with this field in it, that is when the
export goes wrong. I am using an Input Mask to format the field on the
report (00/0000;;_).

Thanks for any further advice
Sandy
 
Back
Top