Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Within Crystal Report 10 I am doing a report.

I have 2 formula @Address1 & @Address2.

What is the correct syntax to do the following....

if field.area = "New York" then
display @address1
else
display @address2

Just recently starting using Crystal Report and also hope I have the correct forum. Sorry if in wrong area.
Posted

Try:
SQL
if {Customer.Region}  = 'New York'
then {Customer.Address1}
else {Customer.Address2}


For sample crystal formulas, look here:
Ken Hamady's Crystal Reports Formulas[^]
Formula via code[^]
 
Share this answer
 
Comments
Central_IT 17-Feb-11 9:25am    
Tried it and it work. Thanks for the advice
Your formula should be like below
C#
if {field.area} = "New York" then
{@Address1}
else
{@Address2}
 
Share this answer
 
Comments
Central_IT 17-Feb-11 9:25am    
Tried it and it work. Thanks for the advice

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900