I have a problem with datepart. I want to obtain the week from one date. I have seen the documentation about datepart and the problem with the week counter but I have still problems.
For example.
I want to get the week from this date 29 Dec 2003. This week with DATEFIRST=1 must be the first of 2004 (datepart(ww,'12/29/2003')) but the system give me the 53 week from 2003
the first day of 2004 is on the same week an this function give me different results.
SELECT datepart(ww,'12/29/2003')
SELECT datepart(ww,'1/1/2004')
I don't understand anything ¿?
Thanks a lot.the paper calendar tht you have may show the two dates on same week...but technically the first one is the last week for tht year and the second one is the first week for the year..here the "week" is w.r.t the year..
hth|||I don't understand your reply very well... I read the ISO and it's very clear about what is the first week of the year... but the system works as it wants... if I try this with asp.net it works fine.
No comments:
Post a Comment