Solved

Job Costing Database with Changing Rates

Posted on 2014-12-17
5
24 Views
Last Modified: 2016-08-22
Hello,

I have created an access database for one of my customers which is used for timesheet entry.

Within the database i have a table called "Timesheets" which contains all of the timesheet entries for all of the employees. Each entry is assigned against a job (I have another table which contains all of the jobs which are available).

In this case all of my employees bill out at the exact same rate no matter what job they work on. However on weekends they bill at a different rate. Saturdays the first two hours the employee works is billed at 1.5x the normal rate and any further work is billed out at 2x rates. All Sunday is billed out at the same rate of 2x.

What i am trying to accomplish is a way for access to automatically find the first two hours that an employee works on a Saturday so that i can bill it against the job at the lower rate and then will all remaining work at 2x.

One of the problems that i see is that i might not have a job or two jobs that will always line up on 2 hours. For example if Joe worked 9-12 on a Saturday, the first 2 hours of that 3 hour job is billed at 1.5x  and the final hour is at 2x.

My second issue is that an employee may work on 5 jobs in a single day or come back and working on a single job multiple times with breaks in between. I need a way to check and see if an employee has already billed out his 2 hours total of 1.5x and if not use the remaining time up before billing at 2x.

At the end of all of this i need to have reports which can show where the 1.5x have been allocated and where the 2x has been allocated.

Any thoughts would be great as im all out of ideas.
0
Comment
Question by:infinnet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 18

Expert Comment

by:Simon
ID: 40504319
It would be useful if you could post the table structure (fieldname and datatypes) for your timesheet table.
0
 

Author Comment

by:infinnet
ID: 40504337
Timesheet Table:

ID - AutoNumber
Job Number - Number (Used to match Job Name in a table called Jobs)
Date - Date/Time (Date worked, in format d/mm/yyyy)
Employee Name - Number (Used to match Employee Name to a table called Employees)
Time Start - Date/Time (Start time in format Short Time. All in 24hr time)
Time Finish- Date/Time (Finish time in format Short Time. All in 24hr time)
0
 
LVL 18

Accepted Solution

by:
Simon earned 500 total points (awarded by participants)
ID: 40504469
Hi, please try this. I changed your field names slightly, partly because 'DATE' is a reserved word and I wasn't sure if you'd posted exact field names. I can modify it if necessary, but you should get the idea.
The query includes a subquery that sums total time per employee per day per job and then uses the format 'ddd' function to get the day name and use that to identify 'Sat' and 'Sun' and then uses a conditional to calculate the billable hours.

SELECT qryHoursWorked.JobNo, qryHoursWorked.EmployeeName, qryHoursWorked.DateWorked, qryHoursWorked.Hours, Format([dateworked],"ddd") AS Dayname, IIf([dayname]="Sun",[hours]*2,0)+IIf([dayname]="Sat",[hours]*1.5,0)+IIf([dayname]="Sat" And [hours]*24>2,([hours]-2/24)*0.5,0)+IIf(Left([dayname],1)<>"S",[hours],0) AS BillableHours
FROM (SELECT tblTimesheet.JobNo, tblTimesheet.EmployeeName, tblTimesheet.DateWorked, Sum([timeend]-[timestart]) AS Hours
FROM tblTimesheet
GROUP BY tblTimesheet.JobNo, tblTimesheet.EmployeeName, tblTimesheet.DateWorked
ORDER BY tblTimesheet.DateWorked) as qryHoursWorked
;

Open in new window


Using this timesheet data:
ID      JobNo      DateWorked      EmployeeName      timeStart      timeEnd
6      2      Sat 13/12/2014      Sue      09:00      12:00
4      1      Sat 13/12/2014      John      09:00      12:00
3      1      Sat 13/12/2014      John      12:30      15:00
5      1      Sun 14/12/2014      John      09:00      17:00
2      1      Wed 17/12/2014      John      12:30      15:00
1      1      Wed 17/12/2014      John      10:00      12:00

I get these results:
JobNo      EmployeeName      DateWorked      Hours      Dayname      BillableHours
1      John      Sat 13/12/2014      05:30      Sat      10:00
2      Sue      Sat 13/12/2014      03:00      Sat      05:00
1      John      Sun 14/12/2014      08:00      Sun      16:00
1      John      Wed 17/12/2014      04:30      Wed      04:30
0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 41754648
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question