Page 1 of 1

concat in browse form

Posted: Sun May 14, 2023 3:57 pm
by hering
Hello,

I have problem with CONCAT in browse.

Browse>Columns>Display:

Code: Select all

CONCAT(wyr_operacja_c,wyr_operacja_s,wyr_operacja_m)
In browse it works for some rows and for some it doesn't.

thx.

Re: concat in browse form

Posted: Sun May 14, 2023 4:50 pm
by kev1n
Hi,

Have you tried running the query in phpMyAdmin to view the generated SQL and check if the output is as expected?
(see Form Info -> Browse SQL to view the generated SQL)

Please note that concatenating a string with NULL will always result in NULL.

Using IFNULL handles the case If any of these values are NULL, they are replaced with an empty string before concatenation.

Code: Select all

CONCAT(IFNULL(wyr_operacja_c,''),IFNULL(wyr_operacja_s,''),IFNULL(wyr_operacja_m,''))

Re: concat in browse form

Posted: Tue May 16, 2023 6:45 pm
by hering
Thank You.
NULL was a problem ;-)