Hello all,I have the following query:select '', ca0.nrid , ca0.ref as CampaignId, ca0.var1, ca0.var2, ca0.var3, ca0.var6, ca0.var12, var19, ca0.dat1, ca0.begin_date, (select case count(ea.advert_id) when 1 then 'X' end from sysadm.extadvert ea where ea.ca0_nrid=ca0.nrid and ea.advert_lang='nl-BE') as 'NL', (select case count(ea.advert_id) when 1 then 'X' end from sysadm.extadvert ea where ea.ca0_nrid=ca0.nrid and ea.advert_lang='fr-BE') as 'FR', (select case count(ea.advert_id) when 1 then 'X' end from sysadm.extadvert ea where ea.ca0_nrid=ca0.nrid and ea.advert_lang='en-GB') as 'EN'from sysadm.ca0 ca0 where (select count(am6.ap01_name) from sysadm.am6 am6 right join sysadm.am0 am0 on am0.nrid=am6.am0_nrid where am6.ap00_name='Languages' and am6.template IS NULL and am0.titulaire = :strUserNom and ap01_name in (select advert_lang from sysadm.extadvert ea where ea.ca0_nrid=ca0.nrid)) =(select count(ea.advert_lang) from sysadm.extadvert ea where ea.ca0_nrid=ca0.nrid)and ca0.type='SEM' and ca0.var12='1 - New' order by ca0.dat1, ca0.ref
The section in red is putting an X in my column if the language exists in a campaign.We use this query for different country's and now they have asked me if it's possible to use this query for each country,based on the two last digits of the ea.advert_lang field.If it is BE or GB, the section in red should remain, if it is something else it should not be shown (because the other countries have only one language specification)I think i must place another case on top of the red section, but i'm not sure how (because of the choice of the last two digitsin the language).Any hints, pointers ..Thanks alot already