Bennie47250
Programmer
Using Crystal Version 7.0 on a MSSQL 7.0 database.
Needing help determining how to select only the records I want.
The report I working with is joining together 4 tables. One of the tables, among other things, logs the date and status of the ticket. A ticket can have several different statuses and the same status can be used several different times.
Example of the status table
Ticket # Date Status
258 1/2/2005 Open
258 1/2/2005 Pending
258 1/15/2005 Pending
258 1/20/2005 Holding
258 2/5/2005 Pending
258 2/10/2005 Closed
For this report, we want to show calls that the Last occurrence of pending was on a specific date or in a given month.
What I have done is created a formula that is in the detail section of the report that is “if {Status Table.Status} = 'Pending' THEN{ Status Table.Date} This will give me the all the dates of only the statuses of Pending. This formula is named “PendingDates”
I then created another formula to only give me the maximum date of the above formula. This formula is “Maximum ({@PendingDates}, {TicketLog.Ticket#})) This formula is named “MaxPendingDate” and it is in the Group Footer
As I was building these formulas, it was my intent to select records based off the formula MaxPendingDate. However when I try to do this, I receive the error message “This formula can not be used because it must be evaluated later”
Thru my working with the report I have found that if I right click on the formula “PendingDates” and select Insert Summary and select the Maximum of @PendingDates, it puts in a field titled “Max of @ PendingDates” in the Group Footer. I can now select records based off this field; however I’m only able to select “group selection” off this field.
When I ran the report using this as the “group selection”, the report evaluated over 86,000 records (the number in the lower right hand corner of the report when it is finished running and over 500 tickets shown in the group tree) but it only showed the 11 records that were at a status of pending for 3/28/05.
I’m looking for better ways to select the records.
Thanks
Needing help determining how to select only the records I want.
The report I working with is joining together 4 tables. One of the tables, among other things, logs the date and status of the ticket. A ticket can have several different statuses and the same status can be used several different times.
Example of the status table
Ticket # Date Status
258 1/2/2005 Open
258 1/2/2005 Pending
258 1/15/2005 Pending
258 1/20/2005 Holding
258 2/5/2005 Pending
258 2/10/2005 Closed
For this report, we want to show calls that the Last occurrence of pending was on a specific date or in a given month.
What I have done is created a formula that is in the detail section of the report that is “if {Status Table.Status} = 'Pending' THEN{ Status Table.Date} This will give me the all the dates of only the statuses of Pending. This formula is named “PendingDates”
I then created another formula to only give me the maximum date of the above formula. This formula is “Maximum ({@PendingDates}, {TicketLog.Ticket#})) This formula is named “MaxPendingDate” and it is in the Group Footer
As I was building these formulas, it was my intent to select records based off the formula MaxPendingDate. However when I try to do this, I receive the error message “This formula can not be used because it must be evaluated later”
Thru my working with the report I have found that if I right click on the formula “PendingDates” and select Insert Summary and select the Maximum of @PendingDates, it puts in a field titled “Max of @ PendingDates” in the Group Footer. I can now select records based off this field; however I’m only able to select “group selection” off this field.
When I ran the report using this as the “group selection”, the report evaluated over 86,000 records (the number in the lower right hand corner of the report when it is finished running and over 500 tickets shown in the group tree) but it only showed the 11 records that were at a status of pending for 3/28/05.
I’m looking for better ways to select the records.
Thanks