Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query expression

Status
Not open for further replies.

exphtur

Technical User
Jul 23, 2003
23
IE
I have an ASP script that connects to a Microsoft Access database and returns a payroll report. I have been able to get it to display totals of hours worked by hourly rate for each employee, but I want to be able to calculate time-and-a-half for hours worked in excess of 40 hours and double-time for hours worked in exces of 45, do I need to do this by creating an expression within the query ? If so how, please?

Thanks

webtoon
 
[tt]select employeename
, sum(hoursworked) as totalhoursworked
, iif(sum(hoursworked) > 40
, iif(sum(hoursworked) <= 45
, sum(hoursworked)-40 , 5 )
, 0 ) as timeandahalfhours
, iif(sum(hoursworked) > 45
, sum(hoursworked)-45
, 0 ) as doubletimehours
from payrolltable
group
by employeename [/tt]

rudy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top