Thomas
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you.
Haven't worked in access for a while now but I guess it may be a "Microsoft design", not sure.
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
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
ASKER