CASE WHEN (ROUND_DAY("PAYMENT_TABLE"."Payment registered date")) <
PU_MAX(DOMAIN_TABLE("PAYMENT_TABLE"."CG Key"), "PAYMENT_TABLE"."Payment registered date", ROUND_DAY("PAYMENT_TABLE"."Payment registered date") IS NOT NULL
)
THEN ROUND_DAY("PAYMENT_TABLE"."Payment registered date") ELSE NULL END