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

Ideas for building chart

Status
Not open for further replies.

vxxv

Programmer
Jan 23, 2004
32
PT
Hi,

I've a problem on how to build a chart. I work with CR 8.5 and I need to count the number of occurrences that wr_id has. But that number depends on verifying some aspects.
My table has some fields like (the ones that I need to check):
wr_id;pmp_id;pms_id;prob_type;date_issued;status;
date_completed

To count the wr_id's I need to separate them by:
1) Those who have pmp_id null and pms_id null and prob_type <> 'PREVENTIVE MAINT' are the "Corrective".
2) Those who have pmp_id not null and pms_id not null and prob_type = 'PREVENTIVE MAINT' -> are the "Preventive".

Then I need to count, for the Preventive ones and for the Corrective ones the respective wr_id's that has these restrictions:
a) not issued: date_issued is null and status = 'AA' and date_completed is null;
b) active: date_issued is not null and status in ['I','HP','HL','HA'] and date_completed is null;
c) complete: date_completed not null and status in ['COM','CNC','CLO'] and date_issued is not null.

If anyone has some ideia to help me I'll be very grateful.

Thanks,
Jaime


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top