March 8, 2010 at 5:45 pm
Hi Friends,
I have to add a table to our existing database which will be storing the a period of time i.e Say Summer Vacation it will be for 3 weeks and people will be providing me the start date. I have to calculate automatically the next 3 weeks using find week query"SELECT DATEPART( wk, '2010-04-15 23:12:04.000')". How can i change this query or write a new query to take current date and provide me the ouput as yes when current date falls in that Summer vacation.
March 8, 2010 at 9:18 pm
Ismail Ahmed (3/8/2010)
Hi Friends,I have to add a table to our existing database which will be storing the a period of time i.e Say Summer Vacation it will be for 3 weeks and people will be providing me the start date. I have to calculate automatically the next 3 weeks using find week query"SELECT DATEPART( wk, '2010-04-15 23:12:04.000')". How can i change this query or write a new query to take current date and provide me the ouput as yes when current date falls in that Summer vacation.
Use DATEADD to calculate the other boundary and use it in a CASE statement. If you want a more specific coded answer, please provide more specific data to test with. See the first link in my signature line below for how to do that.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply