Hi @ASHMITP ,
Welcome to Microsoft Q&A!
You could use IIF instead of 'if'.
syntaxsql
IIF( boolean_expression, true_value, false_value )
Please refer below:
select IIF([visit_id]='abd',"yes","No")
from dbo.data_pcoc_episode
Best regards,
Melissa
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.