Base: How to make block address

Hi,

I’m trying to create a calculated field in Base that contains a person’s address in block format:-

Address line 1
Address line 2
Town
County
Zip code

The reason for this is that if, for example, Address line 2 is empty, I want the block address field to contain only:-

Address line 1
Town
County
Zip code

The BlockAddress field is the one that I will be using in a mail merge.

I can do the “exclusion” of Address line 2 if empty but I cannot get the calculated field to show the line breaks.
I have tried all the following (excluding the ‘skip blank line’ logic):-

“Address line 1” || CHAR(10) || “Address line 2”

“Address line 1” || CHAR(13) || “Address line 2”

“Address line 1” || CHAR(10) || CHAR(13) || “Address line 2”

“Address line 1” || CHAR(13) || CHAR(10) || “Address line 2”

None of these works.

Is there any way of doing this, please?

The version in use is: LibreOffice 3.5.7.2 Build ID: 350m1(Build:2)

Since you are doing mail merge, have you considered adding the fields individually? The document 0211WG34-UsingMailMerge.pdf describes how to suppress blank fields in mail merge. It’s somewhat involved, but works. The document may be found by Googling “libreoffice 0211wg34-usingmailmerge.pdf”

Thanks for that. I have used that method in the past and found it cumbersome and time-consuming. I really had hoped to be able to solve the issue using a query. I have done that successfully using MySQL but not with LibreOffice Base.