TheOneRing
Programmer
I have two tables.
tblServiceTask and tblServiceTaskTech
tblServiceTask holds the billed labour etc for each task and tblServiceTaskTech holds all the times for each technician that worked on a particular task. Now if I do a query joining these tables together, then I can get duplicate values and therefore duplicate dollar amounts. Is there any easy way to eliminate the duplicates without having to write and VBCODE to search for them.
This is the code that I currently use and then I use vbcode to search through and list the duplicates. Is there an easier way:
SELECT tblServiceTask.strServiceTaskNumber, tblServiceTask.dblBilledLabour, tblServiceTask.dblBilledTravel, tblServiceTask.dblBilledParts, tblServiceTask.dblPartsCost, tblServiceTaskTech.dblBilledLabourHours, tblServiceTaskTech.dblBilledTravelHours, tblServiceTask.dtmServiceTaskEndDate
FROM tblServiceTask INNER JOIN tblServiceTaskTech ON tblServiceTask.lngServiceTaskID = tblServiceTaskTech.lngServiceTaskID
WHERE (((tblServiceTask.dtmServiceTaskEndDate) Between CDate('01-02-02') And CDate('28-02-02')));
thanks,
Darren
tblServiceTask and tblServiceTaskTech
tblServiceTask holds the billed labour etc for each task and tblServiceTaskTech holds all the times for each technician that worked on a particular task. Now if I do a query joining these tables together, then I can get duplicate values and therefore duplicate dollar amounts. Is there any easy way to eliminate the duplicates without having to write and VBCODE to search for them.
This is the code that I currently use and then I use vbcode to search through and list the duplicates. Is there an easier way:
SELECT tblServiceTask.strServiceTaskNumber, tblServiceTask.dblBilledLabour, tblServiceTask.dblBilledTravel, tblServiceTask.dblBilledParts, tblServiceTask.dblPartsCost, tblServiceTaskTech.dblBilledLabourHours, tblServiceTaskTech.dblBilledTravelHours, tblServiceTask.dtmServiceTaskEndDate
FROM tblServiceTask INNER JOIN tblServiceTaskTech ON tblServiceTask.lngServiceTaskID = tblServiceTaskTech.lngServiceTaskID
WHERE (((tblServiceTask.dtmServiceTaskEndDate) Between CDate('01-02-02') And CDate('28-02-02')));
thanks,
Darren