Connecting 2 sets of data together

ConfusedA

Registered User.
Local time
Today, 09:09
Joined
Jun 15, 2009
Messages
101
What I have:
2 queries:
Q1;
Jobs
Via Truck (total cost)
Year
Month

Q2;
Jobs
via Employee (total cost)
Year
Month


Both queries *should* overlap so that the hours spent in a truck and by an employee on a job would be equal. *BUT* I want to ensure that if the values do not overlap exactly that the values are present.

Currently I have my query reporting the values that overlap (IE if Job1 is input for both employee and truck it appears) and can calculate a total per job (total cost employee + total cost truck)

But I am only inputting test values for employees at the moment so unless i input a job for each employee for each job (which ideally will happen anyways) I do not see the jobs only done by trucks. Is there any way to store the values for jobs done by truck that do not match to jobs done by employee so that I can see their cost as well?

IF this doesn't make sense I can attempt to rephrase.

Thanks in advance.
ConfusedA
 
UPDATE: Ok, what I have done as a temporary solution is to create an empty employee that has 0 hours in every job. This will not work as a long term solution though, as it displays no data when I attempt to search by month or year.

Essentially what I require is an addition to my three sets of search criteria:
Like IIf(IsNull([Forms]![frmMainSBJ]![lstyear]),"*",[Forms]![frmMainSBJ]![lstyear])
Like IIf(IsNull([Forms]![frmMainSBJ]![lstmonth]),"*",[Forms]![frmMainSBJ]![lstmonth])
Like IIf(IsNull([Forms]![frmMainSBJ]![lstjob]),"*",[Forms]![frmMainSBJ]![lstjob])

That will allow me to display data when either the employee's hours are not recorded or if a truck is not used for a job. If not associated with thes 3 fields maybe within my total cost field: Total Cost: Sum(CCur([Total Cost1]+[Total Cost2]))
Where Total Cost1 = Sum((([fldHours]+[Call Out (2)])*[Average Wage])+(([Call Out (1)]+[Overtime])*[Average Wage]*1.5)) per job/month/year

and Total Cost2 = Total Cost2: Sum(CCur([Totcost]))

Totcost = Totcost: [SumOfJobHour]*[JobCost] by truck (jobcost is associated with truck)/year/month/job
 
Figured it out. I did it by changing my values so that they'd match up in an UNION Query, for those who care.
 

Users who are viewing this thread

Back
Top Bottom