Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using the EXTRACT function to get year and month from date

658699Sep 10 2008 — edited Sep 12 2008
Hello~
I am trying to extract the month and year using the query below but am getting the error:

Query cannot be parsed within the Builder



select distinct city AS "CITY",count(MOTOR_ASSIST2.CITY) as "COUNT"
from "MOTOR_ASSIST2" "MOTOR_ASSIST2"
where
(
(:P53_FISCAL_YR IS NULL OR :P53_FISCAL_YR = MOTOR_ASSIST2.FY)

*OR (:P53_MONTH IS NULL OR EXTRACT(MONTH FROM :P53_MONTH) = MOTOR_ASSIST2.DATETIME)
OR (:P53_YEAR IS NULL OR EXTRACT(YEAR FROM :P53_YEAR) = MOTOR_ASSIST2.DATETIME))*
GROUP BY MOTOR_ASSIST2.CITY
ORDER BY CITY

Can anyone help me figure out what im doing wrong?Thanks

Deanna
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 10 2008
Added on Sep 10 2008
9 comments
1,774 views