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

Address Formula

Status
Not open for further replies.

adam7

Technical User
Nov 26, 2002
20
GB
Hi there, I'm using CR 8.5 and I have a table with fields on that make up the address of a company. I have put these fields into a formula which seems to work quite well....

if not isnull ({ADDRESS_shipping.ADDRESS1})
or {ADDRESS_shipping.ADDRESS1}<>""
then trimright({ADDRESS_shipping.ADDRESS1})+chr(13)+
if not isnull ({ADDRESS_shipping.ADDRESS2})
or {ADDRESS_shipping.ADDRESS2}<>""
then trimright({ADDRESS_shipping.ADDRESS2})+chr(13) +
if not isnull ({ADDRESS_shipping.ADDRESS3})
or {ADDRESS_shipping.ADDRESS3}<>""
then trimright({ADDRESS_shipping.ADDRESS3})+chr(13) +
if not isnull ({ADDRESS_shipping.CITY})
or {ADDRESS_shipping.CITY}<>""
then trimright({ADDRESS_shipping.CITY})+chr(13) +
if not isnull ({ADDRESS_shipping.STATE})
or {ADDRESS_shipping.STATE}<>""
then trimright({ADDRESS_shipping.STATE})+chr(13)+
if not isnull ({ADDRESS_shipping.POSTALCODE})
or {ADDRESS_shipping.POSTALCODE}<>""
then trimright({ADDRESS_shipping.POSTALCODE})+chr(13)

It works fine except sometimes the address3 is blank, and it leaves a line in the address like this....

3 The Smiths
Bob Town

Leicester
Leicestershire
LE12 1 ER

Any ideas on how to get around it at all?

Thanks
 
Have a look at this thread for some options: thread767-759458.

-dave
 
Easy when you know how!! Thanks a lot for that
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top