livingstong713
Technical User
I am using Crystal Reports XI
Our address formats could have any number of fields missing data, i.e. there could be a City and State, but no Zip or the City and State could both be entered into the City field leaving the State field empty. I have started a formula that has been working, but of course there is always that one off that throws a wrench in the whole formula. I have mapped this formula to to insure that I have covered all bases, but I can not get it to populate for one particular customer that does not have a zip code. Here is my formula thus far:
if isnull({SHIPTO.City}) and isnull({SHIPTO.State})
and isnull ({SHIPTO.ZIP})
then ({SHIPTO.Country})
else if isnull({SHIPTO.City}) and isnull({SHIPTO.State})
then {SHIPTO.ZIP}
else if isnull ({SHIPTO.ZIP}) then {SHIPTO.City} + ', '+ {SHIPTO.State}
else if isnull({SHIPTO.City}) and not isnull({SHIPTO.State}) then {SHIPTO.State} + {SHIPTO.ZIP}
else {SHIPTO.City} + ', '+ {SHIPTO.State}+ ' ' +{SHIPTO.ZIP}
So, in a sense I want it to return whatever value is there and suppress what is not, but keep it in a nice format.
Any help is greatly appreciated.
Thanks in advance,
Genie
Our address formats could have any number of fields missing data, i.e. there could be a City and State, but no Zip or the City and State could both be entered into the City field leaving the State field empty. I have started a formula that has been working, but of course there is always that one off that throws a wrench in the whole formula. I have mapped this formula to to insure that I have covered all bases, but I can not get it to populate for one particular customer that does not have a zip code. Here is my formula thus far:
if isnull({SHIPTO.City}) and isnull({SHIPTO.State})
and isnull ({SHIPTO.ZIP})
then ({SHIPTO.Country})
else if isnull({SHIPTO.City}) and isnull({SHIPTO.State})
then {SHIPTO.ZIP}
else if isnull ({SHIPTO.ZIP}) then {SHIPTO.City} + ', '+ {SHIPTO.State}
else if isnull({SHIPTO.City}) and not isnull({SHIPTO.State}) then {SHIPTO.State} + {SHIPTO.ZIP}
else {SHIPTO.City} + ', '+ {SHIPTO.State}+ ' ' +{SHIPTO.ZIP}
So, in a sense I want it to return whatever value is there and suppress what is not, but keep it in a nice format.
Any help is greatly appreciated.
Thanks in advance,
Genie