Link to home
Start Free TrialLog in
Avatar of jturkington
jturkington

asked on

Compare Dates Weekly Starting From Monday Instead Of Sunday ?

I want to work out weekly stats on specific records for the year, what i want to achieve is the following:  -

I want to count a new week starting on a monday and ending on sunday

For each year start week 1 on the first monday of january

How do i go about setting this up ?

I have the following query but this counts from Sunday first

SELECT COUNT(*)
FROM Table
WHERE DATEPART(week, GETDATE()) = DATEPART(week, dateadded)


So the output would be for today 12/04/05: -

WEEK 15

Record count 3 etc..

Cheers

JT
ASKER CERTIFIED SOLUTION
Avatar of mrichmon
mrichmon

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jturkington
jturkington

ASKER

of course ..........., sorry for the silly question

JT
no problem.

I can't tell you how many times I have missed the obvious answer thinking it must be more complex.