cancel
Showing results for 
Search instead for 
Did you mean: 

How to display a record in multiple groups

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

DellSC
Active Contributor
0 Kudos

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