case blockTypeChar when 'G' then CASE WHEN BlockType=1 then (SELECT rtrim(LastName)+', '+rtrim(Firstname) from coPer WHERE coPerID=meetings.blkPerID) else (SELECT GroupName from group_ WHERE GroupID=meetings.BlkPerID) end when 'S' then (Select SpecDesc from coSpec where coSpec.SpecID=meetings.SpecID) end as BlockDesc>I have the query below, that I need to expand the functionality logic of the case. As it is, the case statement checks to see if BlockType=1, if so, it does one query, otherwise it does another. I now need to expand to this logic, but I'm not sure how to format it correctly for syntax.
>case blockTypeChar > when 'G' then > if BlockType=1 then > (SELECT rtrim(LastName)+', '+rtrim(Firstname) from coPer WHERE coPerID=meetings.blkPerID) > else > (SELECT GroupName from group_ WHERE GroupID=meetings.BlkPerID) > endif > when 'S' then (Select SpecDesc from coSpec where coSpec.SpecID=meetings.SpecID) >end as BlockDesc >>