SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 sql query to retrieve corresponding week last year
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

amit82
Starting Member

12 Posts

Posted - 03/07/2007 :  03:51:56  Show Profile  Reply with Quote
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)

Singapore
17642 Posts

Posted - 03/07/2007 :  03:56:08  Show Profile  Reply with Quote
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


Edited by - khtan on 03/07/2007 03:56:33
Go to Top of Page

amit82
Starting Member

12 Posts

Posted - 03/07/2007 :  04:40:04  Show Profile  Reply with Quote
please guys please make it fast please...
sql server 2000
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17642 Posts

Posted - 03/07/2007 :  04:46:29  Show Profile  Reply with Quote
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 - 03/07/2007 :  05:38:49  Show Profile  Reply with Quote

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)

Singapore
17642 Posts

Posted - 03/07/2007 :  09:05:22  Show Profile  Reply with Quote
make use of dateadd() function


KH

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000