on 12-28-2012 9:26 AM
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.
Try:
SELECT
T0.[DocNum],
T0.[DocDate],
DATEPART (wk, T0.Docdate+1) AS 'WEEK NUMBER',
YEAR (T0.Docdate) AS 'YEAR'
FROM OINV T0
WHERE T0.[DocDate] >= [%0] AND T0.[DocDate] <= [%1]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please clarify your definition of the week number. Is it related 52 weeks in a year?
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tomasz Bolesta,
I think you need to change settings before run the query.
Thanks & Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.