Skip to Content
0
Former Member
Dec 28, 2012 at 09:26 AM

Query with proper week number: Tuesday - Monday

33 Views

Dear all,

I need to retrieve week numbers from Docdate start - Tuesday end - Monday, the below example query is for Monday - Sunday

SELECT

T0.[DocNum],

T0.[DocDate],

DATEPART (wk, T0.Docdate) AS 'WEEK NUMBER',

YEAR (T0.Docdate) AS 'YEAR'

FROM OINV T0

WHERE T0.[DocDate] >= [%0] AND T0.[DocDate] <= [%1]

Thank you for your help.