I am trying to put an if condition within a where clause and I cannot figure out the correct syntax for what I want.
The logic should be if a certain period is equal to a specific number then check to make sure pdftype is not null else then don't check it all.
Here's what I have so far:
where  
    g.ReportInstanceID = blah
    and rcr.FormID = blah
    and rcr.FormSectionID = blah
    and rcr.SubSectionID = blah
    and CASE rcr.DataCollectionPeriodID 
           WHEN 163 THEN (PDFType IS NOT NULL)
        END
 
     
     
    