Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Totals by day of a date range 1

Status
Not open for further replies.

netrusher

Technical User
Feb 13, 2005
952
US
Below is the SQL Code I am using to determine the Total Count of WorkUnits for a particular date range. What I would like to be able to do is get the total Count of WorkUnits for each day in the date range. Can anyone help me accomplish this?

Code:
SELECT 'Total Work Units' AS FaultCategory, Count([WorkUnit]) AS [WU Totals-Out of Stock]
FROM (Select Distinct [WorkUnit]
         FROM WorkUnitsFaultsMainTBL
            WHERE BuildID IN ("E010","C809","F001","C810","F187","A910","M173","M174") AND
            PossibleCause NOT IN ("Out of Stock") AND
                [TodaysDate] BETWEEN [Forms]![Queries_ReportsFRM]![StartDateTxt] AND
                                        [Forms]![Queries_ReportsFRM]![EndDateTxt])AS vTbl;
 
Perhaps this ?
SELECT TodaysDate, Count(*) AS [WU per day]
FROM (SELECT DISTINCT WorkUnit, TodaysDate FROM WorkUnitsFaultsMainTBL
WHERE BuildID IN ("E010","C809","F001","C810","F187","A910","M173","M174")
AND PossibleCause NOT IN ("Out of Stock")
AND TodaysDate BETWEEN [Forms]![Queries_ReportsFRM]![StartDateTxt] And [Forms]![Queries_ReportsFRM]![EndDateTxt]
) AS vTbl
GROUP BY TodaysDate

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top