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 strongm 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
 
You will probably have to create one more recordset that get's the information once more (without the SUM function) and then you pass the numbers into a asp/vbscript function that do the calculation for you.


Regards


M
 
Something like this:

SELECT employeeid, ( SUM(hours) - 45 ) * @HOURLYRATE
FROM payroll
GROUP BY employeeid
HAVING SUM(hours) > 45

br
Gerard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top