Been scouring Google, looking for an ORACLE equivalent to SQL Server "DatePart". I found one thing, and it's not working:
Code:
SELECT ...
FROM ...
WHERE DatePart(tbl.DateField,DP_YEAR) = 2012
I keep getting a "DATEPART: invalid identifier" message. This is Oracle 10g.
Does anyone know the proper way to compare the year portion of a date to a value like "2012"?
Thank you,
__________________ ^_^
If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
* The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
DBMS are far from my strong point especially oracle. But I'm not familiar with the DATEPART function. The error indicates that oracle isn't either (maybe a pl/sql specific?). I always use EXTRACT when I need to pull something out of Oracle by year: