I have a database which basically holds addresses
The table (tblAddress) looks like this...
housename | housenumber | address1 | address2 | address3 | town | postcode
Banana House | 29 | Acacia Road | Yellow Skin Way | | Nuttytown | W1 1MP
When I search the database based on a postcode I want to be able to return and result like this...
Banana House,29 Acacia Road,Yellow Skin Way,Nuttytown,W1 1MP
So I need the housenumber concatenated with address1 IF address1 is populated. If not then concat with address2 or address3. Then the rest of the address to follow as per the example.
I tried using IF and CASE statements but can't seem to get anywhere near the output I'm after.
Hope that makes sense.