Link to home
Start Free TrialLog in
Avatar of Thomas
ThomasFlag for United States of America

asked on

How to show a single decimal digit in a query.

I want to show work hours to one decimal in an Access 2013 query. My SQL statement is:

SELECT tblWorkRecords.WorkHours, Round([WorkHours],0) AS Expr1, Round([WorkHours],1) AS Expr2
FROM tblWorkRecords
ORDER BY tblWorkRecords.WorkHours DESC;

As seen in the example results, Expr2 does not show a single decimal as I expected.

User generated image
ASKER CERTIFIED SOLUTION
Avatar of Ares Kurklu
Ares Kurklu
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Thomas

ASKER

Yes, that works. Do you know why? Thanks.
Avatar of Thomas

ASKER

Thank you.
Haven't worked in access for a while now but I guess it may be a "Microsoft design", not sure.
Avatar of Dale Fye
Using format converts the value to a string, rather than a number, so the value will be left aligned in your query field.

In query design, go to grid section (bottom) and highlight the column you want to format.  Then display the properties dialog and on the format tab, select

Format: Fixed
Decimals: 1