Month comparison from dates in where clause
511922May 11 2006 — edited May 12 2006Hi,
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