CASE Expression not doing what I want
What I want to achieve is this:
When DATE+365 is less than OTHERDATE AND it is equal to YETANOTHER DATE THEN 'Correct'
Right now my code looks like this:
(CASE WHEN ((X2.TERMDATE + 365) < X1.LASTHIRE) IS (X1.ORIGINALHIRE) THEN 'Correct'
WHEN ((X2.TERMDATE + 365) < X1.LASTHIRE) IS (X3.LASTHIRE) THEN 'Correct'
WHEN ((X2.TERMDATE + 365) > X1.LASTHIRE) IS (X1.LASTHIRE) THEN 'Correct'
ELSE 'ERROR' END)
Is this possible? Where am I going wrong?