-
Merging fields in a query??
Hi All,
I am having difficulty with a query 
Basically I want to Merge three fields into one field in a query from my table as they are three lines of an address.
I used the following code in query design:
[Address Line 1]&" "&[Address Line 2]&" "&[Address Line 3]
Which worked perfectly, however I need these seperated with a comma so I adjusted as follows:
[Address Line 1]&", "&[Address Line 2]&", "&[Address Line 3]
Which again worked HOWEVER my problem is that half of the entries do not have an Address Line 2 so there output in the query is; address line 1, , address line 3.
How do I get rid of the second comma if the second field (address line 2) is blank???
Thanking you in advance
-
-
CONCAT(address1, ', ', IF(address2 != '', CONCAT(address2, ', ', '')), address3)
-
The Following User Says Thank You to Twey For This Useful Post:
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks