I’m attempting to create column that shows a different result based on a date test. On my current code, I only show either ‘MM’ or ‘YY’, but would like to concat text to the end of ‘MM’ and text only instead of ‘YY’. I can’t seem to find the problem in the code and hoped you’d spot my error quickly. It is clearly somewhere in the CASEWHEN as when I remove it, and the last DATEDIFF, it works fine.
Thank you in advance,
Joe Castor
SELECT "MemberID" AS "Bage #", "LastName" || ', ' || "FirstName" AS "Name", "DateJoined" AS "Date Joined", "LastRenewalDate" AS "Last Renewal", "MemberThruDate" AS "MemberThru", "MemberType" AS "Type", "Family",
CASEWHEN( "MemberThruDate" =< "TODAY", DATEDIFF('mm', "MemberThruDate","TODAY"), DATEDIFF('yy', "MemberThruDate","TODAY")) AS "Mos Over Due"
FROM "MemberMaster" WHERE "NotActive" <> 1 ORDER BY "LastName" ASC, "FirstName" ASC