Is there some way to calculate the date for the monday (monday is first day
of w


I.e. given the w

2005.
Regards.
SuneYou can use a calendar table, see http://www.aspfaq.com/2519
"Sune Hansen" <sdhXXX@.vertica.dk> wrote in message
news:%23w7PFR7sFHA.3236@.TK2MSFTNGP14.phx.gbl...
> Hi all,
> Is there some way to calculate the date for the monday (monday is first
> day of w


> I.e. given the w

> 2005.
> Regards.
> Sune
>|||Build a calendar table of dates and w

value from that.
SELECT w

FROM Calendar
WHERE cal_date = '20050905' ;
To calculate the w

given in the CREATE FUNCTION topic in Books Online (assuming you do in
fact want to use ISO w

David Portas
SQL Server MVP
--|||Do:
SELECT CURRENT_TIMESTAMP - @.@.DATEFIRST + 1
Anith|||Mistake:
SELECT DATEADD( d, @.wk * 7, DATEPART( wk, '20050101' ) -
( 7 - @.@.DATEFIRST ) ) - @.@.DATEFIRST + 1
-- where @.wk is your w

Anith
No comments:
Post a Comment