I am effectively trying to create a timesheet system for an engineering company. They have a list of 'favourite jobs' that automatically populate their timesheet for the week. Another problem is, that jobs all have sub-jobs, for the purposes of booking time to them, to then later invoice... What also populates the timesheet, is any other job, IF it has time booked to it.
So Basically, when the timesheet system is launched, i already have in place, the automatic selection of the current week, with the ability to go back a week...
I have these tables
==== Job ====
Job_ID
Job_Description
...
==== User ====
User_ID
User_Name
...
==== FavouriteJobs ====
Job_ID
User_ID
==== SubJobs ====
Job_ID
SubJ_ID
SubJ_Description
==== Timesheet ====
Job_ID
SubJ_ID
User_ID
Time_Date
Time_Hours
Time_Mileage
In the end i need all this information, in the statement...
Job_ID, Job_Description, Subj_ID, Subj_Description, Time_Date, Time_Hours
I want to in effect do this....
SELECT All the sub jobs, of favourite jobs for the current user, AND All subjobs of jobs with time booked to them, between the start and end of a week
I can either do this in two statement, such as
Select all the subjobs of the favourite jobs for the current user; showing time booked to them IF there is any
and
Select all the subjobs of the jobs for the current user that have time booked to them
This will then allow me to populate a data grid, with a row for each subjob, in the format:
Job_ID - Job_Description - Subj_ID - Subj_Description
5645 - IT Document Control - 1 - MAIN SUBJOB
with then, a column for each day of the week, filled with the amount of time thye have booked...
If this makes ABSOLUTELY no sense and is total babble, please ask me to try and explain further, or make it a bit clearer on whatever parts...
Thanks!
So Basically, when the timesheet system is launched, i already have in place, the automatic selection of the current week, with the ability to go back a week...
I have these tables
==== Job ====
Job_ID
Job_Description
...
==== User ====
User_ID
User_Name
...
==== FavouriteJobs ====
Job_ID
User_ID
==== SubJobs ====
Job_ID
SubJ_ID
SubJ_Description
==== Timesheet ====
Job_ID
SubJ_ID
User_ID
Time_Date
Time_Hours
Time_Mileage
In the end i need all this information, in the statement...
Job_ID, Job_Description, Subj_ID, Subj_Description, Time_Date, Time_Hours
I want to in effect do this....
SELECT All the sub jobs, of favourite jobs for the current user, AND All subjobs of jobs with time booked to them, between the start and end of a week
I can either do this in two statement, such as
Select all the subjobs of the favourite jobs for the current user; showing time booked to them IF there is any
and
Select all the subjobs of the jobs for the current user that have time booked to them
This will then allow me to populate a data grid, with a row for each subjob, in the format:
Job_ID - Job_Description - Subj_ID - Subj_Description
5645 - IT Document Control - 1 - MAIN SUBJOB
with then, a column for each day of the week, filled with the amount of time thye have booked...
If this makes ABSOLUTELY no sense and is total babble, please ask me to try and explain further, or make it a bit clearer on whatever parts...
Thanks!