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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prorate 10 Truck Hours over total hours worked for day

Status
Not open for further replies.

bailey11

Technical User
Jan 18, 2005
103
US
When we enter time, I need to create a query that prorates 10 hours (truck hours) over the jobs time is entered against for a single employee for a day.

The employee time for 8/14/06 is:

Job 26000, 5 hours
Job 27009, 6 hours

employee time for 8/15/06 is:
job 26000, 4 hours
job 27009, 4 hours

I need a query that creates/appends a table as follows:

8/14, job 26000, (5/11*10)
8/14, job 27009, (6/11*10)
8/15, job 26000, (4/8*10)
8/15, job 27009, (4/8*10)

 
From the data above, perhaps something like this:

[tt]SELECT A.JobDate, A.JobNo, A.JobHours, ([JobHours]/(Select Sum(JobHours) From Table1 B Where B.JobDate=A.JobDate))*10 AS PR
FROM Table1 AS A;[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top