Avatar of Lee R Liddick Jr
Lee R Liddick Jr
Flag for United States of America

asked on 

SQL query and if statement

In my where statement I need to check two areas, if the first isn't populated, check the other.

if a.C_EFF_DT is NOT NULL then a.C_EFF_DT < date(current date - 6 months)
if a.C_EFF_DT is NULL then b.C_EFF_DT < date(current date - 6 months)

So basically if the first C_EFF_DT is null then check the second C_EFF_DT, if it has a date, then check it and don't worry about the second date.
DatabasesSQL

Avatar of undefined
Last Comment
Lee R Liddick Jr

8/22/2022 - Mon