Using Crystal 10 on SQL Server.
Using two tables, work_orders, and work_order_details, linked by a common work order number with an inner join. There can be many records in the details table to each work order in the main table.
In the details table is a field called actionID. I need to check all the action ID's for each work order, looking for a specific action ID (2custinit is the name of it). When I do a simple if-then like this:
if {work_order_details.action id} = "2custinit" then
custinit_flag = "Yes"
else
custinit_flag = "No";
it always evaluates to false, even when that action id is present. It looks like it's only evaluating the most recent detail record instead of checking all of them. How do I step through all the detail records checking for this specific string?
I've tried grouping on the action id field with the if-then in the details section or the group footer, but it still always returns false.
The action ID I'm looking for might or might not be there, so I have to check for it and set a flag of some sort. If it is present, then I have to do some date/time calculations. I can manage those, but I can't figure out why I can't determine if the action id is present.
I've got a feeling that there's a simple solution to this and I'm going to feel foolish when someone points it out, but I'm at wits end with this problem.
Thanks for any help offered.
Kevin
Using two tables, work_orders, and work_order_details, linked by a common work order number with an inner join. There can be many records in the details table to each work order in the main table.
In the details table is a field called actionID. I need to check all the action ID's for each work order, looking for a specific action ID (2custinit is the name of it). When I do a simple if-then like this:
if {work_order_details.action id} = "2custinit" then
custinit_flag = "Yes"
else
custinit_flag = "No";
it always evaluates to false, even when that action id is present. It looks like it's only evaluating the most recent detail record instead of checking all of them. How do I step through all the detail records checking for this specific string?
I've tried grouping on the action id field with the if-then in the details section or the group footer, but it still always returns false.
The action ID I'm looking for might or might not be there, so I have to check for it and set a flag of some sort. If it is present, then I have to do some date/time calculations. I can manage those, but I can't figure out why I can't determine if the action id is present.
I've got a feeling that there's a simple solution to this and I'm going to feel foolish when someone points it out, but I'm at wits end with this problem.
Thanks for any help offered.
Kevin