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
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