I have this query in DB2
SELECT * FROM SOMESCHEMA.SOMETABLE WHERE SYSDATE > @A
If the SYSDATE is NULL, would it be
SYSDATE
NULL
You can use this solution for comparing of two nullable dates (P.EndDate,C.EndDate):
[MinDate] = CASE WHEN ISNULL(C.EndDate,P.EndDate) <= ISNULL(P.EndDate,C.EndDate) THEN ISNULL(C.EndDate,P.EndDate) ELSE ISNULL(P.EndDate,C.EndDate) END