Subject RE: [firebird-support] SQL Error -104
Author Leyne, Sean
> i just don't get it what the heck i'm doing wrong. I would like to have
> something like that:
>
> select ba.artno
> from mov_invoices mi, bas_articles ba
> where mi.invdate between '2014-05-01 00:00:00' and '2014-08-01 00:00:00'
> and case
> when (ba.artno like '90__') then '9000'
> when (ba.artno like '80__') then '8000'
> when (ba.artno like '70__') then '7000'
> when (ba.artno like '60__') then '6000'
> when (ba.artno like '50__') then '5000'
> when (ba.artno like '40__') then '4000'
> when (ba.artno like '30__') then '3000'
> when (ba.artno like '20__') then '2000'
> when (ba.artno like '10__') then '1000'
> end

Try

select
case
when (ba.artno like '90%') then '9000'
when (ba.artno like '80%') then '8000'
when (ba.artno like '70%') then '7000'
when (ba.artno like '60%') then '6000'
when (ba.artno like '50%') then '5000'
when (ba.artno like '40%') then '4000'
when (ba.artno like '30%') then '3000'
when (ba.artno like '20%') then '2000'
when (ba.artno like '10%') then '1000'
end
as ba.artno
from mov_invoices mi, bas_articles ba
where
mi.invdate between '2014-05-01 00:00:00' and '2014-08-01 00:00:00'


Sean