K
kabeiroy
Unregistered / Unconfirmed
GUEST, unregistred user!
m4inno為varchar,為什麼會有資料而抓不到資料???
select * from me00.me04h
where m4inno like 'a' + substring(CONVERT(varchar,year(getdate())),4,1)+
case
when month(getdate())= 1 then '1'
when month(getdate())= 2 then '2'
when month(getdate())= 3 then '3'
when month(getdate())= 4 then '4'
when month(getdate())= 5 then '5'
when month(getdate())= 6 then '6'
when month(getdate())= 7 then '7'
when month(getdate())= 8 then '8'
when month(getdate())= 9 then '9'
when month(getdate())= 10 then 'A'
when month(getdate())= 12 then 'C'
when month(getdate())= 11 then 'B'
end+'%'
select * from me00.me04h
where m4inno like 'a' + substring(CONVERT(varchar,year(getdate())),4,1)+
case
when month(getdate())= 1 then '1'
when month(getdate())= 2 then '2'
when month(getdate())= 3 then '3'
when month(getdate())= 4 then '4'
when month(getdate())= 5 then '5'
when month(getdate())= 6 then '6'
when month(getdate())= 7 then '7'
when month(getdate())= 8 then '8'
when month(getdate())= 9 then '9'
when month(getdate())= 10 then 'A'
when month(getdate())= 12 then 'C'
when month(getdate())= 11 then 'B'
end+'%'