[AccessD] Excel export problem

Doug Steele dbdoug at gmail.com
Fri Sep 24 11:58:18 CDT 2010


Hello all:

I am trying to export a query to Excel (this works just fine).  One of the
columns contains a decimal number which is a result of calculating the
elapsed hours between two times.  The number of decimal places ranges from
none to 15 (!).  The column is a real mess when it shows up in Excel.  The
user could always reformat the column, but I'd rather export the hours with
2 decimal places only.

If I try to use the Round function "= Round(MyHours,2)", Access ignores it
completely and outputs the original multi decimal places.

If I try to use Format "=Format(MyHours,"0.00")", I get the two decimal
places but Excel flags every cell as 'Number formatted as text'.

If I try to convert the formatted value back to a single
"=CSng(Format(MyHours,"0.00"))", I get the multi decimal numbers I started
with.

Does anyone have a solution?

Thanks,
Doug



More information about the AccessD mailing list