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

shifting date range

Status
Not open for further replies.

jschill2628

Programmer
Nov 3, 2009
156
US
Is it possible to write in the selection criteria that I want a specific time frame. I would like to schedule the report to run for the last six months (at any given time).

For example I want the report to run on the 15th of every month and we are in October, but I would like the data for April 1, 2010 through September 30, 2010. Is there a way to write this into the selection criteria?

Thanks in advance
 
Try DateDiff, determine the difference in months, and display the result next to the (unselected) data. That should give you 1 for September 2010 and 6 for April, so you'd select for a range 1 to 6.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
{table.date} in dateserial(year(currentdate),month(currentdate)-6, 1) to
date(year(currentdate),month(currentdate),1)-1

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top