on 12-23-2014 2:55 PM
Crystal Reports
We perform Preventive Maintenance on equipment and there is a field called {PLT_PREVENTIVE_MAINTENANCE.NEXT_SCHEDULED_DATE} . If I were to run a report, I could display all the PMs grouped by next scheduled date. The problem is that some of the PMs are recurring. I want my monthly PMs to display again for each month, quarterlies to display every 3 months etc.
The formula I tried was
if {PLT_PREVENTIVE_MAINTENANCE.FREQUENCY} = 1 and {PLT_PREVENTIVE_MAINTENANCE.FREQUENCY_MEASURE} = "months"
then DateAdd ( "m", +0 ,{PLT_PREVENTIVE_MAINTENANCE.NEXT_SCHEDULED_DATE} )
else
f {PLT_PREVENTIVE_MAINTENANCE.FREQUENCY} = 1 and {PLT_PREVENTIVE_MAINTENANCE.FREQUENCY_MEASURE} = "months"
then DateAdd ( "m", +1 ,{PLT_PREVENTIVE_MAINTENANCE.NEXT_SCHEDULED_DATE} )
else
f {PLT_PREVENTIVE_MAINTENANCE.FREQUENCY} = 1 and {PLT_PREVENTIVE_MAINTENANCE.FREQUENCY_MEASURE} = "months"
then DateAdd ( "m", +2 ,{PLT_PREVENTIVE_MAINTENANCE.NEXT_SCHEDULED_DATE} )
etc
The result of the above should have a monthly PM appear in the month of its next scheduled date, and again in each of the following months.
Each individual record will only appear once on the report. So, the only way to meet your requirement is probably going to be to create a view or stored procedure in the database or a command (SQL Select statement) in the report that will provide a record for future dates for each recurrence of a PM.
If you'll provide the type of database you're connecting to and the structure of the tables involved along with any parameters you're using, I might be able to help you write the SQL for a command or view.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.