Date query--Urgent Help

PANKAJINFO1

Registered User.
Local time
Today, 21:10
Joined
Jul 4, 2009
Messages
16
I have a problem with the result of a Query.


Start Date
End Date


Query runs after entering unbound pameter text box Start and end date.
What i want is i am grouping of Opertaor, sum of defects between the dates.

but dates i am not able to group or sum or etc.

I want when the start and end date is entered

Operator Sum of Defects
A 25
B 75
C 12

SELECT tbloperator.[Operator Name] AS operator, tblModel.[Model Desc] AS Model, Sum([Daily Production].[Total Production]) AS Prod, Sum(tblinsp.[Number of Defects]) AS Defect, Round(([tblinsp].[Number of defects])/([daily production].[total production]*[tblmodel].[no of Joints])*1000000,2) AS PPM, tblModel.[No of Joints], Tblmain.date
FROM tbloperator INNER JOIN ((tblModel INNER JOIN [Daily Production] ON tblModel.Modelid = [Daily Production].[Model id]) INNER JOIN (tbldefect INNER JOIN (Tblmain INNER JOIN tblinsp ON Tblmain.inspid = tblinsp.inspid) ON tbldefect.defectid = tblinsp.defectid) ON tblModel.Modelid = tblinsp.modelid) ON tbloperator.operatorid = tblinsp.operatorid
WHERE (((Tblmain.date)=[daily production].[date]))
GROUP BY tbloperator.[Operator Name], tblModel.[Model Desc], Round(([tblinsp].[Number of defects])/([daily production].[total production]*[tblmodel].[no of Joints])*1000000,2), tblModel.[No of Joints], Tblmain.date, [Daily Production].[Model id]
HAVING (((Tblmain.date) Between [Forms]![Date Selection]![textdate] And [Forms]![Date Selection]![End date]))
ORDER BY tbloperator.[Operator Name];


Please help - Urgent
 
Use a where condition in your query instead of putting the parameters underneath the actual fields. This removes the HAVING syntax.

David
 
I replaced group by with Where but still the same i am attaching the package i created.


use "date selection" Form PPMquery and run the query please check "Coil Shop" should be grouped but the problem is they are separated because dates are different.

What i want "Coil Shop" should in group.

Please select July ~Aug09 Dates.
 

Attachments

Without looking any deeper into your problem in your query you are using

Between x and Y and z you cannot do this

Also having fields called Date is only going to cause problems. This is a reserved word in Access. You need to change this ASAP.

David
 
please can you solve this.
i changed name of the field in inspdate
 
Bumping threads and crying out for help does not get you any more favour that waiting for members to give their FREE support. We do this out of kindness and it is not obligatory. It may be that someone is actually looking at this issue right now and are attempting to resolve it. If you cannot wait then I suggest you attempt to resolve it yourself.

David
 
Can I Hope a Solution from The forum. I am still Hanging.

Please Solve
 

Users who are viewing this thread

Back
Top Bottom