I wrote a simple query to compare dates but I am getting an invalid identifier error on the last line of the query. I get the following error below. Line 15 happens to be the last line of the query.
Error at Line: 15 Column: 6
Select OP_DATE,
ID,
TO_CHAR(DT.OP_DATES.LST_UPDT_TMSP,'DD-MM-YY') as SD
From DT.OP_DATES
Where OP_DATE_IND = 'CMPLTD'
And OP_DATE_STS = 'M'
And SD=(SELECT TO_CHAR(SYSDATE, 'DD-MM-YY') FROM DUAL)
What's wrong with the identifier?