Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Static date range 1

Status
Not open for further replies.

itguymike

Technical User
May 27, 2005
28
US
i am trying to create a static date range for a report.. basically i want any {PURCHASE_ORDER.DESIRED_RECV_DATE} dates that are 3 days before the currentdate to 14 days in he future.

any help would be appreciated

 
{PURCHASE_ORDER.DESIRED_RECV_DATE} in dateadd("d",-3,currentdate) to
dateadd("d",14,currentdate)

This will give the date range from 4/22/2014 to 5/9/2014.
 
BettyJ's suggestion is absolutely correct, however it is worth noting that when adding/subtracting whole days it is not necessary to use the DateAdd function - you can simply add or subtract the number of days as follows:

Code:
{PURCHASE_ORDER.DESIRED_RECV_DATE} in (CurrentDate-3) to (CurrentDate+14)


Cheers
Pete
 
Pete,
Wasn't aware of that. I will definitely start using that from now on. Thank you very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top