andy_dyer
Registered User.
- Local time
- Today, 04:23
- Joined
- Jul 2, 2003
- Messages
- 806
Ok...
I have the following query:
SELECT qryDataWeeklyHours.[User Name], qryDataWeeklyHours.[Timesheet Period], qryDataWeeklyHours.[Weekly Hours], qryDataWeeklyHours.[Discretionary Hours], IIf([discretionary hours]>=0,[discretionary hours],"0") AS [New Discretionary Hours]
FROM qryDataWeeklyHours
GROUP BY qryDataWeeklyHours.[User Name], qryDataWeeklyHours.[Timesheet Period], qryDataWeeklyHours.[Weekly Hours], qryDataWeeklyHours.[Discretionary Hours];
I have a seperate query that feeds this one that totals the amount of hours worked in a week for every member of staff and then calculating the difference between this and the standard 37.5 hours.
This query should take that and then check if the discretionary hours (difference between the two) is + or - if positive then keep the number if - then replace the number with a 0...
It appears to do this for most lines but for some it is doing something weird...
Weekly Hours Discretionary Hours New Discretionary Hours
37.58 0.079999999999998 7.99999999999983E-02
39 1.5 1.5
For the top example it's doign something with the decimal places that i don't understand... sorry if this is really simple...
Anybody help??
I have the following query:
SELECT qryDataWeeklyHours.[User Name], qryDataWeeklyHours.[Timesheet Period], qryDataWeeklyHours.[Weekly Hours], qryDataWeeklyHours.[Discretionary Hours], IIf([discretionary hours]>=0,[discretionary hours],"0") AS [New Discretionary Hours]
FROM qryDataWeeklyHours
GROUP BY qryDataWeeklyHours.[User Name], qryDataWeeklyHours.[Timesheet Period], qryDataWeeklyHours.[Weekly Hours], qryDataWeeklyHours.[Discretionary Hours];
I have a seperate query that feeds this one that totals the amount of hours worked in a week for every member of staff and then calculating the difference between this and the standard 37.5 hours.
This query should take that and then check if the discretionary hours (difference between the two) is + or - if positive then keep the number if - then replace the number with a 0...
It appears to do this for most lines but for some it is doing something weird...
Weekly Hours Discretionary Hours New Discretionary Hours
37.58 0.079999999999998 7.99999999999983E-02
39 1.5 1.5
For the top example it's doign something with the decimal places that i don't understand... sorry if this is really simple...
Anybody help??