SQL SERVER 2005-MAX FUNCTION

Tags:
MAX
SQL Server
SQL Server 2005
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?
ASKED: June 6, 2008  6:18 PM
UPDATED: October 16, 2013  9:49 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

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: http://itknowledgeexchange.techtarget.com/it-support/ If it has a plug, it’s IT stuff!

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following