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!

Scehduling and paramaters 1

Status
Not open for further replies.

ganjass

Technical User
Dec 30, 2003
154
GB
CE10

Hi all,

i have a report that has a lot of date paramater dependant calculations in it. The report has to be run daily at midnight or 00:01 to report the last 24 hours eg at 00:00:01 on 04/06 i would run the report from 03/06 00:00:00 to 04/06 00:00:00 for the date paramaters. I would need to schedule this to run every night with the day before dates in the paramaters eg 05/06 would then be 04/06 00:00:00 to 05/06 00:00:00. The report has a lot of calculations based on the date to and date from paramatar fields, would i have to change the report to have day-1 equations in it, or could i program crystal to populate the parmater fields so that every day it moves them 1 day on. I hope this makes sense.

Thanks in advance
 
You can't use code for automatically incrementing parameters unless you're doing parameter collection in external code (as opposed to a CR Viewer).

However you shouldn't need a parameter at all to derive dates.

Yesterday from the previous month for the same date would be:

{table.field} >= dateadd("m",-1,currentdate-1)
and
{table.field} >= currentdate-1

The fact that your report uses lots of calculations against parameters could be resolved going forward by going against formulas derived from the minimum and maximum parameter value, for instance the above would use 2 formulas to derive the dates and the record selection formula would reference those formulas instead of the hard coded dates.

Btw, your post was quite confusing, try supplying examples and desired results rather than extended descriptions.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top