[AccessD] Excel export problem

Asger Blond ab-mi at post3.tele.dk
Fri Sep 24 12:39:26 CDT 2010


Did you try to make a query and set the property for the field to Fixed with 2 decimals, then export this query to Excel?
This works for me.
Asger

-----Oprindelig meddelelse-----
Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] På vegne af Doug Steele
Sendt: 24. september 2010 18:58
Til: Access Developers discussion and problem solving
Emne: [AccessD] Excel export problem

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
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list