May 18, 2005 at 2:55 am
Lo to all,
Is Anyone fafamiliar with "week function" in sql server?
Why is creating week 53 avery new year?
Regards,Lital.
May 18, 2005 at 6:19 am
Are you talking about the DATEPART function that returns the week of the date that is passed to it ?!
I'm not sure about the week 53 you mention - if you pass a date that falls in the first week of a new year it should give you week 1 !!!
**ASCII stupid question, get a stupid ANSI !!!**
May 18, 2005 at 6:22 am
First thanks,
second Yes i am talking about DatePart.
The reason the year 2004 has 53 weeks is because the last week in that year was mostly on 2004
The sql not acting like a calander.
May 18, 2005 at 7:00 am
The rules for week numbers are different between different countries. I am not sure which rules are specific for you, but take a look at my article On the trail of the ISO week for an example of getting ISO week numbers.
May 18, 2005 at 7:13 am
So there is noting to do?
May 18, 2005 at 7:38 am
What do you mean exactly? No, there is no way to have the DATEPART function return week numbers caculated with other rules, but you can do it yourself (like I show in my article for ISO week numbers).
May 18, 2005 at 7:42 am
I will do it amigo , Regards.
May 18, 2005 at 7:53 am
I have never had cause to use this function before - amazing how much you can learn from every single post on this site...
Chris - once again, thanks for the detailed article on this - btw - are you on this site 24/7 ? I actually logged on at 2 am and saw you being the sql good samaritan ! <:-)
**ASCII stupid question, get a stupid ANSI !!!**
May 18, 2005 at 8:31 am
No, not really 24/7, but some days I check in about once an hour between 8AM and 2AM, perhaps with a break around dinnertime.
May 18, 2005 at 9:42 am
Good heavens Chris - what keeps the machine running ?!?! Caffeine ???
**ASCII stupid question, get a stupid ANSI !!!**
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply