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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date range help 1

Status
Not open for further replies.

Bennie47250

Programmer
Nov 8, 2001
515
US
Crystal 7.0
MS SQL Database

Would like to have a formula or selection criteria to do the following.

Let’s say something is scheduled to ship on 7/25/13. I would like the record to show up on the report in 7/20, 7/21, 7/22, 7/23, 7/24 and finally 7/25. When the report runs on 7/26, the record no longer appears. The report will run every day of the week

Thanks
Bennie
 
without knowing more about your report/data this is just a guess.

i would start with selection criteria something like:

{table.shipdate} < currentdate

 
Or perhaps:

Code:
{Table.ShipDate} in [CurrentDate to (CurrentDate + 5)]


Cheers
Pete
 
pmax9999,

That is the solution I came up with too. Was hoping to find another more efficent way to do this.

Thanks
Bennie
 
Bennie47250

What is it that you believe is inefficient about this code (when used in the Record Selection)?
 
Maybe inefficient is not the correct word I was looking for, how about something "slicker".

When I first looked at this I thought maybe I could use something like <= current date -5 or similar and since I could not get that to work figured I was just not smart enought to figure it out.

Regards
 
Not sure if this will help, but anyway
{Table.ShipDate} in [dateadd("d",-5,CurrentDate) to CurrentDate]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top