I need to pull data from tables with millions of rows and limit it to just the past two years. I am working on developing a SQL statement to enter into Power BI to limit what it pulls. Obviously I am a novice but I cannot figure this out and all suggested approaches are not working for me. It is also unclear to me how to convert, limit, and pull all of the data from this table.
The LOADED_DATE column is char(8) so first I used TO_DATE to convert it, as you can see, but I am not sure what I am missing.
SELECT TO_DATE(LOADED_DATE, 'YYYYMMDD')
FROM ELLIPSE.MSF26A
WHERE LOADED_DATE >= ADD_MONTHS(SYSDATE,-24)
SQL Error [1861] [22008]: ORA-01861: literal does not match format
string
wolfmansbrother505 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.