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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

formula

Status
Not open for further replies.

GRECONCG

Technical User
Oct 8, 2009
31
US
Hi I have this

IF {CUST.COUNTRY}='' then 'U.S.A.' else{COUNTRY.NAME}

I am using that so that all us states come under one heading but I also need to compare the customers state with the address state and if the customer state does not equal the address state to make it the address state else customer state. I thought if I added this to the above it would do what I want:

and IF {CUST.STATE}<> {ADDRESS.STATE} then {ADDRESS.STATE} else {CUST.STATE}

but it tells me it wants a boolan, is there a way to get thsi to work? Thanks
 
To be a little clearer I need to be picking up the address state but I'm not sure if I should do it in this formula or in selection?
 
Hi,
yoiu need 2 formulas:
@FixCountry
Code:
IF ( 
TRIM({CUST.COUNTRY})= '' or IsNull({CUST.COUNTRY}) 
) then 'U.S.A.' 
else 
 {COUNTRY.NAME}

@CheckState
Code:
If {CUST.STATE}<> {ADDRESS.STATE} 
 then {ADDRESS.STATE}
  else {CUST.STATE}



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
When I insert the check state formula I now get duplicate records
 
These are formula fields not selection formulas.

The duplicates might be because people have multiple addresses? If so you might be able to filter on the primary address, or group the records and hide the details.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top