 Former Member

# CRW - Select Expert not providing the desired results

The following select Expert formula is giving me inconsistent results:

if {?SortName} <> '' then {HRRM.SortName} = {?SortName} else 1=1 and

if {?Employee} <> 0 then {HRRM.HRRef} = {?Employee} else 1=1 and

if {?Craft} <> '' then {HRRM.StdCraft} = {?Craft} else 1=1 and

if {?IncludeInactive?} = "N" then {HRRM.ActiveYN} = "Y" Else 1=1 and

{HRRM.StdClass} in {?BegClass} to {?EndClass} and

{HRRM.udDateLastCheck} in {?BegDate} to {?EndDate} and

{HRRM.HRCo} = {?HRCo}

Depending on the sequence that these statements are in seems to determine how the CRW selects the data. All formulas work by them self but donu2019t provide the desired results when but together.

Is there an order which these statements should be in? If I move them around I get different results.

10|10000 characters needed characters exceeded

### Related questions

• Former Member
Posted on Jan 13, 2009 at 04:20 PM

Hi William

Can you try modifying the formula as given below:

if {?SortName}="" then {HRRM.SortName} = {?SortName} else 1=1 and

if {?Employee} =0 then {HRRM.HRRef} = {?Employee} else 1=1 and

if {?Craft}="" then {HRRM.StdCraft} = {?Craft} else 1=1 and

if {?IncludeInactive?} = "N" then {HRRM.ActiveYN} = "Y" Else 1=1 and

{HRRM.StdClass} in {?BegClass} to {?EndClass} and

{HRRM.udDateLastCheck} in {?BegDate} to {?EndDate} and

{HRRM.HRCo} = {?HRCo}

Thanks

10|10000 characters needed characters exceeded
• Former Member

The actual statement is as follows:

if {?SortName} <> "" then {HRRM.SortName} = {?SortName} else 1=1 and

if {?Employee} <>0 then {HRRM.HRRef} = {?Employee} else 1=1 and

if {?Craft}<>"" then {HRRM.StdCraft} = {?Craft} else 1=1 and

if {?IncludeInactive?} <>"N" then {HRRM.ActiveYN} = "Y" Else 1=1 and

{HRRM.StdClass} in {?BegClass} to {?EndClass} and

{HRRM.udDateLastCheck} in {?BegDate} to {?EndDate} and

{HRRM.HRCo} = {?HRCo}

It's displaying all records regardless of company?