Hello,
I am on CR version 2008, using it to report on building maintenance workorders. Trying to pull workorder records using a combination of fields, including 3 different date fields. I'm getting the right results with the date fields.
However, due to inconsistencies of various people entering data, many of the workorders have blank (null) "work type" fields. And I am not able to pull the workorders that have a null work type field using the selection formula below. On reports with less complex selection formulas, I usually am able to get around this problem using a simple "OR" statement like this:
isnull ({workorder.worktype}) or {workorder.worktype} in ["PM","CM"]
But it is not working with this formula. Any help on how to include workorders with null "work type" fields would be appreciated.
Selection formula:
if (isnull ({workorder.worktype}) or {workorder.worktype} in ["AD","CC","CG","CM","EM","EV"]) then
(
({workorder.status} in ["COMP", "CLOSE"]
and
({workorder.reportdate}>= {?Start Date} and
{workorder.reportdate}<= {?End Date}) and
({workorder.actfinish} >= {?Start Date} and
{workorder.actfinish}<= {?End Date}))
or
({workorder.status} in ["INPRG", "PENDING", "WSCH", "WMATL", "APPR", "WAPPR", "WPCOND"]
and
{workorder.reportdate}>= {?Start Date} and
{workorder.reportdate}<= {?End Date})
)
else
{workorder.worktype} in ["PM"]
(
({workorder.status} in ["COMP", "CLOSE"]
and
({workorder.targstartdate}>= {?Start Date} and
{workorder.targstartdate}<= {?End Date}) and
({workorder.actfinish} >= {?Start Date} and
{workorder.actfinish}<= {?End Date}))
or
({workorder.status} in ["INPRG", "PENDING", "WSCH", "WMATL", "APPR", "WAPPR", "WPCOND"]
and
{workorder.targstartdate}>= {?Start Date} and
{workorder.targstartdate}<= {?End Date})
)
I am on CR version 2008, using it to report on building maintenance workorders. Trying to pull workorder records using a combination of fields, including 3 different date fields. I'm getting the right results with the date fields.
However, due to inconsistencies of various people entering data, many of the workorders have blank (null) "work type" fields. And I am not able to pull the workorders that have a null work type field using the selection formula below. On reports with less complex selection formulas, I usually am able to get around this problem using a simple "OR" statement like this:
isnull ({workorder.worktype}) or {workorder.worktype} in ["PM","CM"]
But it is not working with this formula. Any help on how to include workorders with null "work type" fields would be appreciated.
Selection formula:
if (isnull ({workorder.worktype}) or {workorder.worktype} in ["AD","CC","CG","CM","EM","EV"]) then
(
({workorder.status} in ["COMP", "CLOSE"]
and
({workorder.reportdate}>= {?Start Date} and
{workorder.reportdate}<= {?End Date}) and
({workorder.actfinish} >= {?Start Date} and
{workorder.actfinish}<= {?End Date}))
or
({workorder.status} in ["INPRG", "PENDING", "WSCH", "WMATL", "APPR", "WAPPR", "WPCOND"]
and
{workorder.reportdate}>= {?Start Date} and
{workorder.reportdate}<= {?End Date})
)
else
{workorder.worktype} in ["PM"]
(
({workorder.status} in ["COMP", "CLOSE"]
and
({workorder.targstartdate}>= {?Start Date} and
{workorder.targstartdate}<= {?End Date}) and
({workorder.actfinish} >= {?Start Date} and
{workorder.actfinish}<= {?End Date}))
or
({workorder.status} in ["INPRG", "PENDING", "WSCH", "WMATL", "APPR", "WAPPR", "WPCOND"]
and
{workorder.targstartdate}>= {?Start Date} and
{workorder.targstartdate}<= {?End Date})
)