Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 sql query to retrieve corresponding week last year

Author  Topic 

amit82
Starting Member

12 Posts

Posted - 2007-03-07 : 03:51:56
Our databse gets uploaded on daily basis
We use excel for reporting cases

I need a sql query to retrieve the following cases:

Those cases which uploaded in the eqivalent week 6 months ago
Those cases which uploaded in the eqivilent week 1 year ago.

So there fore I need 5 day's worth of data on each worksheet.

we have a week index and a month index and a day index dedicated please help

can anybody please help.....

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-03-07 : 03:56:08
Duplicate http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=80150

Are you using SQL 2000 or version 6.5 / 7 ? Please post in the appropriate forum.


KH

Go to Top of Page

amit82
Starting Member

12 Posts

Posted - 2007-03-07 : 04:40:04
please guys please make it fast please...
sql server 2000
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-03-07 : 04:46:29
What do you mean by "eqivalent week 6 months ago" ?

"So there fore I need 5 day's worth of data on each worksheet."
So you want the query that returns these data ? You have to post your table structure with some sample data and the required result.


KH

Go to Top of Page

amit82
Starting Member

12 Posts

Posted - 2007-03-07 : 05:38:49

Consider this month to be March,2007 and week running is second.
i need the data for september, 2006 second week.
and also i need data for March,2006 second week
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-03-07 : 09:05:22
make use of dateadd() function


KH

Go to Top of Page
   

- Advertisement -