How to use concat and case?

sales2010

Well-Known Member
Hello,

I need to concat some fields in a cdd element, but i coudn't make it work:

this is what i tried in concat label field:

imei,' - ','(select (case alocat when 1 then "IMEI ALOCAT" when 0 then "NEALOCAT" end) from aplicatii_imei_parteneri)'

What i get as result is the imei value and query as plain text. Concated fields are from the same table used to get value for cdd.

Thank you
 
The concat is doing a
CONCAT(whatever-is-in-the-field), so try without quotes
imei,' - ',(select (case alocat when 1 then "IMEI ALOCAT" when 0 then "NEALOCAT" end) from aplicatii_imei_parteneri)
 
What troester said. Don't put quotes around your sub query.

But even then, I'm pretty sure that sub query would need a WHERE clause to select the correct row? Remember that you can use fields from the outer query in your sub-query, and you may need to do that.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top