jeudi 28 septembre 2017

Crystal Reports formula to create new field data based on specific condition?

I am relatively new to Crystal Reports (I have version 2013) so I understand how some things work, but I cannot figure this issue out.

My database source for the report is secure and cannot be changed, so I have to make the change in crystal reports. Basically I have a field called Jurisdiction that has a set number of possible entries. I need to create a new entry in the Jurisdiction field if a certain city is within the CITY field. Here is what I am thinking for code, but I cannot get it right:

if {database.CITY}='SPRINGFIELD' then {database.JURISDICTION}='SPRINGFIELD' 

else {database.JURISDICTION}=defaultattribute

I know that the defaultattribute does not work here, but I do not know what to use. I have also tried the code without the else statement which does not give me any errors, but on the report it displays "False". Also can I create just a regular formula to drag onto the report or should it be created within the Section expert in the details section?

Aucun commentaire:

Enregistrer un commentaire