So before you said:
where
sourcecode in ('125', '154', '264') and opendate >= ‘2021-03-01’ and closingdate <= ‘2023-02-07’ /* and closingdate is null */
If you are doing this in SAS then the syntax would be more like:
where sourcecode in ('125', '154', '264')
and opendate >= '01MAR2021'd
and closingdate <= '07FEB2023'd
Since SAS treats missing values as less than any valid number then "null" values of CLOSINGDATE would be included in that last AND.
If for some reason you had to push that logic into some external database that uses TRI level logic instead of normal BINARY logic you could add that extra condition this way.
where sourcecode in ('125', '154', '264')
and opendate >= '01MAR2021'd
and (closingdate <= '07FEB2023'd or closingdate is null)
... View more