General discussion
September 13, 2005 at 05:42 AM
bop_zw

Report By Date range, Grouped into days

by bop_zw . Updated 21 years ago

I am creating a Stored Procedure to query between a given date range as follows:

SELECT
Ksnr as ‘Cust No’, Artnr as ‘Intier No’, count(*) as Quantity

FROM
JITWork_Archiv

WHERE
(NOT (Sequenznr LIKE ‘0%’)) AND (Letzte_Prioritaet = 11) AND (Zeitstempel BETWEEN CONVERT(DATETIME, @StartDate, 102) AND CONVERT(DATETIME, @EndDate, 102)) and (NOT( Artnr LIKE ‘Dummy’))
Group by Ksnr, Artnr

This works 100%, however I need the result to be by day between 21:40:00 hours and 21:39:59 hours. for a month(Given within the query).

Can someone help?

Thanks

Brian

This discussion is locked

All Comments