JerryEng
11-21-2002, 03:11 PM
I have 3 tables: Jobs; JobCosting; TimeSlips.
Jobs contains fields :
JobNumber (primary key)
JobName
JobCosting contains fields:
CostTicket (primary key)
JobNumber
ItemNumber
Quantity
TimeSlips contains fields:
TimeSlipNum(primary key)
EmployeeID
JobNumber
Hours
I'm trying to write a query that will return all items used on a job and all time applied to the job. Some jobs may have only items. Some jobs may only have time.
I used the query wizard in Access and it came up with this:
SELECT Jobs.JobNumber, Jobs.JobName, JobCosting.ItemNumber, JobCosting.Quantity, TimeSlips.EmployeeNum, TimeSlips.Hours
FROM (Jobs INNER JOIN TimeSlips ON Jobs.JobNumber = TimeSlips.JobNum) INNER JOIN JobCosting ON Jobs.JobNumber = JobCosting.JobNumber
WHERE (((Jobs.JobNumber)=[?]));
This works fine if a job has both items and time but returns nothing if a job has only time or only items.
How can I modify the query so that data is returned even if there are records only in JobCosting or TimeSlips?
Ultimately, I'm trying to generate a report that will show all costs associated with a particular job.
Any help would be greatly appreciated!!
Jobs contains fields :
JobNumber (primary key)
JobName
JobCosting contains fields:
CostTicket (primary key)
JobNumber
ItemNumber
Quantity
TimeSlips contains fields:
TimeSlipNum(primary key)
EmployeeID
JobNumber
Hours
I'm trying to write a query that will return all items used on a job and all time applied to the job. Some jobs may have only items. Some jobs may only have time.
I used the query wizard in Access and it came up with this:
SELECT Jobs.JobNumber, Jobs.JobName, JobCosting.ItemNumber, JobCosting.Quantity, TimeSlips.EmployeeNum, TimeSlips.Hours
FROM (Jobs INNER JOIN TimeSlips ON Jobs.JobNumber = TimeSlips.JobNum) INNER JOIN JobCosting ON Jobs.JobNumber = JobCosting.JobNumber
WHERE (((Jobs.JobNumber)=[?]));
This works fine if a job has both items and time but returns nothing if a job has only time or only items.
How can I modify the query so that data is returned even if there are records only in JobCosting or TimeSlips?
Ultimately, I'm trying to generate a report that will show all costs associated with a particular job.
Any help would be greatly appreciated!!