By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,088 Members | 1,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,088 IT Pros & Developers. It's quick & easy.

Cumulative weeks

P: n/a
Sam
SQL Server 2000 SP3

Hi,

How can I get the cumulative weeks from a givedate to the current
date. I know I can get the weeknumber by using datepart(wk,getdate())
but this will give
me the week number for this year. What if I want to know the number of
weeks
that have passed since june 1 2001. If I use datepart(wk,'20010106') I
will
get the week number for 2001 but I would like the number of weeks
expired between then now.

Thanks,
Reg
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 2 Sep 2004 10:01:12 -0700, Sam wrote:
SQL Server 2000 SP3

Hi,

How can I get the cumulative weeks from a givedate to the current
date. I know I can get the weeknumber by using datepart(wk,getdate())
but this will give
me the week number for this year. What if I want to know the number of
weeks
that have passed since june 1 2001. If I use datepart(wk,'20010106') I
will
get the week number for 2001 but I would like the number of weeks
expired between then now.

Thanks,
Reg


Hi Reg,

select datediff(week, '20010106', getdate())
-----------
191

By the way - '20010106' is january 6, not june 1....

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.