Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Get data month to calander week Expand / Collapse
Author
Message
Posted Sunday, December 22, 2013 1:14 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, August 13, 2014 1:08 PM
Points: 8, Visits: 46
Yes you are correct my week starts from wednesday and end on thrusday.
Post #1525331
Posted Sunday, December 22, 2013 1:16 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, August 13, 2014 1:08 PM
Points: 8, Visits: 46
Yes you correct my start week from thrusay and end on wednesday...
Post #1525332
Posted Sunday, December 22, 2013 2:40 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 4:03 PM
Points: 36,983, Visits: 31,508
Sounds "urgent". Only 4 months have gone by since I asked that question. Have you done anything to help yourself on this problem in all that time?

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1525385
Posted Sunday, December 22, 2013 11:15 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, August 13, 2014 1:08 PM
Points: 8, Visits: 46
Jeff,

Actually very sorry to say i dont find any notification from notifications@sqlservercentral.com. I tried 12 hours my self and now i have done.

Thank you you helped me


Select 'WEEK' = CASE DATEPART(weekday,START_DATETIME)

When 5 then DATEPART(week,START_DATETIME)+1

When 6 then DATEPART(week,START_DATETIME)+1

When 7 then DATEPART(week,START_DATETIME)+1

ELSE DATEPART(week,START_DATETIME)

END

From ...
Post #1525412
Posted Monday, December 23, 2013 5:45 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 4:03 PM
Points: 36,983, Visits: 31,508
Oh, be careful with that. The "week" datepart can change based on the setting of DATEFIRST. And, no... you shouldn't count on that setting.

I'm on my way to work. I'll see what I can do when I get home. Maybe someone else will pick this up in the meantime.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1525494
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse