how to automatically to weekly earnings?

  • Thread starter Thread starter Josh Moore via AccessMonster.com
  • Start date Start date
J

Josh Moore via AccessMonster.com

I have a table recording hours working - 'time in' and 'time out'. In a query I then have a basic string that charges hours worked against the chosen rate which gives me the total for that entry - (in column called 'Cost') . I may have 3 different entries for one day sometimes (if do work for 3 different clients).

How do I create a query that will tell me the total I charged out each week?

So I want it to automatically recognise when the week starts and finishes, add up the totals for the week and have the total appear in another query.

Thanks!
Josh
 
Hi,


Something like


SELECT Client, SUM( (timeout-timein) * costPerHour )
FROM myTable
GROUP BY Client, DatePart("ww", timein)



I assume TimeIn hold the date AND the time. I assume you have ONE record per
operation and that the right rate per hour is already known, for each
record, as costPerHour.



Hoping it may help,
Vanderghast, Access MVP
 
Thanks, I'll try that.

In the mean time I have created a WeekNumber column in the query so each entry for the week has the same Week Number.

Then I have run a crosstab query with the week number and got it to total the amount for that week number.

So that's another solution for others reading this page.

Josh
 
Back
Top