I'm trying to run a query that will drop off experiments if the experiment closed date is before the current date.
Using Excel 2019 and Oracle 12g.
Code:
SELECT distinct e.EXPERIMENT_NUMBER, e.name,
(SELECT value FROM WORKBOOK_DATA WHERE NAME = 'Instrument' AND WORKBOOK_NUMBER = wb.WORKBOOK_NUMBER),
(SELECT value FROM WORKBOOK_DATA WHERE NAME = 'Exp_Date' AND WORKBOOK_NUMBER = wb.WORKBOOK_NUMBER)
FROM EXPERIMENT e JOIN WORKBOOK wb ON wb.EXPERIMENT_NUMBER = e.EXPERIMENT_NUMBER
JOIN WORKBOOK_DATA wd ON wd.WORKBOOK_NUMBER = wb.WORKBOOK_NUMBER WHERE wd.NAME IN ('Instrument', 'Exp_Date')
AND ((wd.NAME = 'Exp_Date') AND To_Date(wd.VALUE,'DD/MON/YY') > To_Date(CURRENT_DATE, 'DD/MON/YY')
OR (wd.NAME = 'Instrument')) AND e.NAME LIKE '%_CAL%'
AND e.GROUP_NAME IN ('ANALYTICAL_PL_RD','DEVELOPMENT_PL_RD','MICRO_PL_RD','RD_PROCESSRESEARCH','PD_PL_RD','SCS_PL_RD')
I get the error
Code:
ORA-01861: literal does not match format string
01861. 00000 - "literal does not match format string"
*Cause: Literals in the input must be the same length as literals in
the format string (with the exception of leading whitespace). If the
"FX" modifier has been toggled on, the literal must match exactly,
with no extra whitespace.
*Action: Correct the format string to match the literal.
How do I get the literals to match? The date format of the Oracle field is DD-MON-RR