I want to display all the due dates within a perscribed period for a repetetive action, where the frequency of the action is every 30 or 90 days and the forcasted start date is one year in the future with an ending date one year later?
My report takes a base inspection date for a specific item and forcasts upcoming dates between the beginning and ending date parameters. I want to view all the dates within the parameters in the detail section of the report.
From the base date, the next inspection date is calculated in the database. The remaining dates I need are created using a formula adding the date with the inspection interval. As an example:
If the inspection interval is every 30 days my report looks like this
Create a VIEW in the database (or SQL query as the report data source, or stored procedure...) that looks like this:
------------------------------------------------------
SELECT X, Y, Z, Inspection_Date FROM Your_Table
UNION ALL
SELECT X, Y, Z, Inspection_Date + 1*{Days_Between} FROM Your_Table
UNION ALL
SELECT X, Y, Z, Inspection_Date + 2*{Days_Between} FROM Your_Table
UNION ALL
SELECT X, Y, Z, Inspection_Date + 3*{Days_Between} FROM Your_Table
...
------------------------------------------------------
All the current (1st part of the UNION query) and future (following parts in the UNION query) inspection dates would show up under the inspection_date column and you can apply a WHERE clause to restrict the date range for which you want results.
Cheers,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
The interval for each task is different. Using a dateadd as you suggest wont work. I have to use the actual_interval. I can get the formula to print the last date of the date range parameter. I want to see all the dates within the parameter. This is the formula I am using to get to the last date.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.