below is the code which i am trying but its is giving blank . I need to insert this result as a row in another table, as it is giving blank due to which i am not able insert it into another table . Can someone please suggest how to replace that count result '' with 0
Select case when (count(ID) is Null ) OR (count( ID) ='' )
then 0 else cast((count( ID)) as varchar(50)) end as Total
from Temp1
where
quarter in ('202203','202204')
group by ID , Quarter having count(ID) >1