datepart function returns "wrong" weeknumber

  • I have a view that uses the datepart(wk, [datefield]) function. Since the new year it returns the "wrong" weeknumber. For example: in my country (the Netherlands) week 1 of the year 2005 is the period january 3 - january 9.

    The function however now returns week 2 when the date is for example january 5.

    Is it possible to change a server setting, making this function to always return the right (in this case Dutch) week in a view.

    I hope somebody can help me.

    Greetings,

    Udjen

     

     

  • You might want to take a look at BOL for "CREATE FUNCTION". There's a nice example how to calculate the ISO week number.

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply