Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving Formula

Status
Not open for further replies.

tomparko

MIS
Apr 11, 2005
9
GB
I am using Crystal 8.5 to run reports from the educational database, EMS.

We have a report that uses the formula below in the Select Expert:

{GOV_LINK.END_DATE} in {?End Date} to {?To end date} and
if {?Select a Governor Type:} = "All" then {GOV_LINK.GOV_TYPE} in ["STF", "SPO", "REP", "PAR", "OTH", "LEA", "FOU", "COM", "CO", "CLK", "ASS", "ADG"] else
if {?Select a Governor Type:} = "LEA" then {GOV_LINK.GOV_TYPE} ="LEA" else
if {?Select a Governor Type:} = "Parent" then {GOV_LINK.GOV_TYPE} ="PAR" else
if {?Select a Governor Type:} = "Staff" then {GOV_LINK.GOV_TYPE} ="STF" else
if {?Select a Governor Type:} = "Community" then {GOV_LINK.GOV_TYPE} ="COM"


Once we refreshed the report and then returned to the Select Expert formula Crystal has automatically changed the formula. The top line (i.e. {GOV_LINK.END_DATE} in {?End Date} to {?To end date}) is moved to the bottom of the formula. Unfortunately this makes a change to the output of the report.

Does anyone know why this happens and has it ever happened to anyone else?

Kind Regards,

Tom
 
It seems since it is an AND operation, it should not make any difference. try putting () around the two parts on each side of the AND like this:

Code:
({GOV_LINK.END_DATE} in {?End Date} to {?To end date})and
(if {?Select a Governor Type:} = "All" then {GOV_LINK.GOV_TYPE} in ["STF", "SPO", "REP", "PAR", "OTH", "LEA", "FOU", "COM", "CO", "CLK", "ASS", "ADG"] else
if {?Select a Governor Type:} = "LEA" then {GOV_LINK.GOV_TYPE} ="LEA" else
if {?Select a Governor Type:} = "Parent" then {GOV_LINK.GOV_TYPE} ="PAR" else
if {?Select a Governor Type:} = "Staff" then {GOV_LINK.GOV_TYPE} ="STF" else
if {?Select a Governor Type:} = "Community" then {GOV_LINK.GOV_TYPE} ="COM")

hopefully with that, Crystal will understand it is two statements pulled together by the AND.
 
Thanks for the reply...

Unfortunately this didn't work. I input the formula u you suggested and it came back with no errors, as expected. However, when we went back into the select expert formula it had returned to its original state with the line:

{GOV_LINK.END_DATE} in {?End Date} to {?To end date}

at the bottom of the formula.

Any other suggestions?

Tom
 
Can't you use The parameter

if {?Select a Governor Type:} <> "All" then {GOV_LINK.GOV_TYPE} = {?Select a Governor Type:}
and
{GOV_LINK.END_DATE} in {?End Date} to {?To end date}

else

{GOV_LINK.GOV_TYPE} in "STF", "SPO", "REP", "PAR", "OTH", "LEA", "FOU", "COM", "CO", "CLK", "ASS", "ADG"]
and
{GOV_LINK.END_DATE} in {?End Date} to {?To end date}







Mo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top