August 19, 2008 at 5:01 am
Hi
I need to place SET DATEFIRST 1
in a view I am creating as I am based in the UK, where Monday is the start of the week.
I am not being allowed to create the view and SET DATEFIRST to 1, has anyone got any ideas on how to tackle this?
August 19, 2008 at 5:16 am
adnaan.afzal (8/19/2008)
HiI need to place
SET DATEFIRST 1
in a view I am creating as I am based in the UK, where Monday is the start of the week.I am not being allowed to create the view and SET DATEFIRST to 1, has anyone got any ideas on how to tackle this?
You cannot set datefirst for views, so either you set it every time you query this view, or stop relying on DATEFIRST.You can write your own function to handle the functionality you need, and can do automatic compensation by querying the @@DATEFIRST variable.
Regards,
Andras
August 19, 2008 at 5:16 am
An example is on:
http://www.eggheadcafe.com/software/aspnet/29116616/weeknumber.aspx
Regards,
Andras
August 19, 2008 at 5:24 am
Thanks Andras
You gave me the inspiration for solving this problem. I have placed the DATEFIRST in DTS that exports the data to Excel and it works.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply