R
rwilliams
Let me preface by saying I am a relative novice at Access and I'm having
trouble with some Queries I created.
My database contains a lists of defects that are reported for our product.
The defects are grouped into categories (manufacturing issue, labelling,
etc). I want to create a query that will total the # of defects in each
category during a user specified time period. I created a form which included
a calendar for user input of start and end dates. The form then returns those
dates to Query#1 which then correctly shows all the defects for the specified
time period. Query#2 is then supposed to calculate the # of defects per
category using the results from Query#1. Query#2 works but it always asks for
the Start and End dates and I'm not sure why it is asking for this as I
thought it would simply use the results from Query#1 and not require reentry
of the dates.
Query#1 SQL:
SELECT OOS.OOSType, OOS.Date
FROM OOS
WHERE (((OOS.Date) Between [Forms]![frmDateFilter]![StartDate] And
[Forms]![frmDateFilter]![EndDate]));
Query #2 SQL:
SELECT NewQry.OOSType, Count(*) AS OOSTypeCount
FROM NewQry
GROUP BY NewQry.OOSType;
What have I done wrong?
TIA
trouble with some Queries I created.
My database contains a lists of defects that are reported for our product.
The defects are grouped into categories (manufacturing issue, labelling,
etc). I want to create a query that will total the # of defects in each
category during a user specified time period. I created a form which included
a calendar for user input of start and end dates. The form then returns those
dates to Query#1 which then correctly shows all the defects for the specified
time period. Query#2 is then supposed to calculate the # of defects per
category using the results from Query#1. Query#2 works but it always asks for
the Start and End dates and I'm not sure why it is asking for this as I
thought it would simply use the results from Query#1 and not require reentry
of the dates.
Query#1 SQL:
SELECT OOS.OOSType, OOS.Date
FROM OOS
WHERE (((OOS.Date) Between [Forms]![frmDateFilter]![StartDate] And
[Forms]![frmDateFilter]![EndDate]));
Query #2 SQL:
SELECT NewQry.OOSType, Count(*) AS OOSTypeCount
FROM NewQry
GROUP BY NewQry.OOSType;
What have I done wrong?
TIA