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!

Month comparison from dates in where clause

511922May 11 2006 — edited May 12 2006
Hi,

My query is as under:

select * from sop_fiscal_calendar_v
where calendar_date BETWEEN trunc(to_date('&date_range_start_date','mm/dd/yyyy'))
AND trunc(to_date('&date_range_end_date','mm/dd/yyyy'))

Here, calendar_date is of DATE datatype.

Need to compare months for the above dates in where clause in the following way:

1) extract month from calendar_date column and check if that month is between the months of input variables date_range_start_date & date_range_end_date. Hence, I need to extract month for all the three dates in the above where clause and compare it.

Thanks,

JP
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 9 2006
Added on May 11 2006
4 comments
1,776 views