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

One Line Address Formula

Status
Not open for further replies.

cantona

Technical User
May 20, 2001
121
GB
Hi,

I want to create a formula or function that will display an address in one line seperated by commas. for example,

High Street,anytown,anywhere

The problem i get is that there are often blanks, which look odd. For example i get;

High Street,,anywhere

What is the easiest way of joining address fields thay may or may not be blank using comma as a seperator? The fields i have are address_line_1, address_line_2,Town, Postcode
 

Code:
nz(address_line_1,"") & nz(","+ address_line_2,"") & nz("," + Town,"") & nz("," + Postcode,"")


note the & and +
 
Hi Pwise,

Thanks for your help! thats exactly what i wanted! for future reference could you perhaps explain the use of & and + ? Ive not used + before.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top