I searched online and this forum and I am not convinced that I find the solution.
I am trying to write a TSQL statement as follows:
SELECT DISTINCT cs.SITE
, CASE WHEN cv.accepted = 1 AND cv.StepNo = 1 then 'Y'
ELSE CONVERT(varchar,[dbo].[fn_Get_WorkingDays] (ci.plannedinstalldt, -17))
dbo.Cy_SiteSurvey AS cs WITH (nolock)
dbo.Cy_Visit_Checklist AS cv WITH (nolock)
ON cv.SysSiteID = cs.SysSiteID
WHERE cv.Visit = 'V1'
This is returning two results. I am expecting only 'Y'. Is this a right way to write CASE statement? Thank you!