kingsgambit
Registered User.
- Local time
- Today, 19:38
- Joined
- May 27, 2001
- Messages
- 134
I have been asked to produce a running total for companies we deal with. on a form I put two text boxes start and end dates
and a listbox that should show all companies with work attached to them between these dates but the result is it shows the same company several times if work has been done on different dates.
I wanted it to show the company only once so the user can click on the comapny and a text box on the form would calculate the hours so far. the query I am using is
SELECT Address.[Last Name], Address.Company, Sum(jobcard.Hoursworked) AS SumOfHoursworked
FROM jobcard LEFT JOIN Address ON jobcard.CustomerID = Address.CustomerID
GROUP BY Address.[Last Name], Address.Company, jobcard.Date
HAVING (((Sum(jobcard.Hoursworked))>0) AND ((jobcard.Date) Between [Forms]![runningtotal]![start] And [Forms]![runningtotal]![stop]));
Any ideas how I could achieve what i wanted
and a listbox that should show all companies with work attached to them between these dates but the result is it shows the same company several times if work has been done on different dates.
I wanted it to show the company only once so the user can click on the comapny and a text box on the form would calculate the hours so far. the query I am using is
SELECT Address.[Last Name], Address.Company, Sum(jobcard.Hoursworked) AS SumOfHoursworked
FROM jobcard LEFT JOIN Address ON jobcard.CustomerID = Address.CustomerID
GROUP BY Address.[Last Name], Address.Company, jobcard.Date
HAVING (((Sum(jobcard.Hoursworked))>0) AND ((jobcard.Date) Between [Forms]![runningtotal]![start] And [Forms]![runningtotal]![stop]));
Any ideas how I could achieve what i wanted