list total

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
 
kingsgambit,

At a glance, I'd say that you should take out the jobcard
date from the group by. Also, Date is a reserved word in
Access and should not be used.

Wayne
 
If I take out the Jobcard date then how can I select between two dates on the form?. The list would be for all dates instead
 

Users who are viewing this thread

Back
Top Bottom