Question

  Asked: Jun 6 2008   6:18 PM GMT
  Asked by: Beginner in IT


SQL SERVER 2005-MAX FUNCTION


SQL Server 2005, MAX, SQL Server

I have a stored proc1 which returns a list of dates for one particular job number.I execute this proc in an other proc2 ,to get the list of all dates.
Then in my proc2 we can get the MAX of this list of dates.
In the WHERE clause of my SELECT statement, i need to filter the result set by dates less than MAX, but greater than MAX – 7 (days).

How should I implement this?

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



Hello
you can use the DATEADD function where you can add/subtract number of fays/months/years to a given date. here you can see more details on this SQL function.
Bye

Don't forget to visit my blog: If it has a plug, it's IT stuff!!
  • AddThis Social Bookmark Button

Browse more Questions and Answers on SQL Server and Development.

Looking for relevant SQL Server Whitepapers? Visit the SearchSQLServer.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register