1 (edited by krokodil_sk 2016-04-18 08:46:43)

Topic: Concat more id_collumn MYSQL

Hi,

i need some little help.

I dont know why my mysql calculate field returns my always =   ' ' nothing

here is my code:


Concat(
(
SELECT Class.Class_Class FROM Class WHERE Class.id = id_Class
)
,(COALESCE(employees.lastname,'')), ' - ' , (COALESCE(employees.firstname,'')),
(
SELECT  school. school_ school FROM school WHERE  school.id = id_ school
))

When the id_Class or the id_school is not set on save form to  databaze ' employees ' .Concat returing me empty cell.

Thx,

K.

Post's attachments

Attachment icon concat.rar 296.19 kb, 776 downloads since 2016-04-18 

Re: Concat more id_collumn MYSQL

Hello,


Try this query

Concat(
(
COALESCE((SELECT Class.Class_Class FROM Class WHERE Class.id = id_Class), '')
)
,(COALESCE(employees.lastname,'')), ' - ' , (COALESCE(employees.firstname,'')),
(
COALESCE((SELECT school.school_school FROM school WHERE  school.id = id_school), '')
)
)
Dmitry.

Re: Concat more id_collumn MYSQL

Great works fine.

Thx,