I am trying to write a query which will give output as MONTH, YEAR.
When I write :
select CAST( tbl.MONTH as varchar(2) ) + ', ' + CAST ( tbl.YEAR as varchar(4) ) as [DATE]
from TABLE as tbl
I get the output as
1,2014
4,2014 (depending upon the input)
But, Now, I want to replace 1 with JAN, 4 with APRIL 12 with DEC
So, I tried to write a case statement as :
SELECT
case when tbl.MONTH ='1'
then ('JAN' + ', ' + CAST ( tbl.YEAR as varchar(4) )) as [DATE1]
from TABLE as tbl
and this gives syntax error. Can anyone tell me, what I should be doing ?