I am stuck on a Crystal Report (7.0) that I need to create a couple of sub-totals on without changing the sort method. This is from our maintenance database (SQL based). I'll try to paint the scenario and then give you an example.
We have work orders from ultiple repair centers. The way I have created this report is to give a "distinct count" of the work order number at the end of the report. What I have been requested to do is also give a distinct count of the work orders in different repair centers...without subtotaling or changing the sorting of the report.
I have tried to use an if,then,else statement with no luck. Here's the example - there are many other fields on the report, but these should be enough to give you an idea.
ex #1 : 00100-R9999 Jiny Neugent Winther Hall PC-4491
ex #2: 00100-4999 Vickie Manke Winther Hall PP-48164
Total # of Open Work Orders: 243 (this is the distinctcount of all work orders on the report...some have repeating lines, that's the reason for the need to use the distinctcount syntax)
I have tried the following statement "if (f_work_order_number) startswith 'PP' then distinctcount (f_work_order_number) else 0
Well needless to say this gives me either the 243 in the original total or a 0
What I'm trying to tell it is if the work order # begins with a PP or a PC (depending on the subtotal) then add up only those that start with that sequence. I also have a repair center code (PP or PC) that I could use to separate the work orders.
I have spent a lot of time trying all the syntaxes I can think of, I'm at wits end (and minus a few more strands of hair), so I'm turning to you folks to see if any of you have an idea of how I can get this info. I can be reached at vanschor@mail.uww.edu or 262-472-1321 x 3011.
Thanks in advance.
rv
We have work orders from ultiple repair centers. The way I have created this report is to give a "distinct count" of the work order number at the end of the report. What I have been requested to do is also give a distinct count of the work orders in different repair centers...without subtotaling or changing the sorting of the report.
I have tried to use an if,then,else statement with no luck. Here's the example - there are many other fields on the report, but these should be enough to give you an idea.
ex #1 : 00100-R9999 Jiny Neugent Winther Hall PC-4491
ex #2: 00100-4999 Vickie Manke Winther Hall PP-48164
Total # of Open Work Orders: 243 (this is the distinctcount of all work orders on the report...some have repeating lines, that's the reason for the need to use the distinctcount syntax)
I have tried the following statement "if (f_work_order_number) startswith 'PP' then distinctcount (f_work_order_number) else 0
Well needless to say this gives me either the 243 in the original total or a 0
What I'm trying to tell it is if the work order # begins with a PP or a PC (depending on the subtotal) then add up only those that start with that sequence. I also have a repair center code (PP or PC) that I could use to separate the work orders.
I have spent a lot of time trying all the syntaxes I can think of, I'm at wits end (and minus a few more strands of hair), so I'm turning to you folks to see if any of you have an idea of how I can get this info. I can be reached at vanschor@mail.uww.edu or 262-472-1321 x 3011.
Thanks in advance.
rv