Search between date ranges

From: Chris <christophercash_at_hotmail.com>
Date: Wed, 30 Jul 2008 03:23:52 -0700 (PDT)
Message-ID: <73b00095-9ba4-4c9c-aa57-3a5e7636d893@56g2000hsm.googlegroups.com>


Hi Guys,

I am trying to bild a cursor based on a select statement which returns values between a certain date range. I have read that it is best avoiding the BETWEEN function of SQL.

Instead I hav written :

AND ol.actual_shipment_date >= p_date_from AND ol.actual_shipment_date <= (p_date_to)

If I have the p_date_from parameter set to 01-JAN-08 and the p_date_to parameter set to 10-JAN-08 it will only return dates from 01-JAN to 09- JAN (not the 10th)

To overcome this I have written :

AND ol.actual_shipment_date >= p_date_from AND ol.actual_shipment_date <= (p_date_to +1)

This seems a very crude way of doing it and was wondering if there is an easier way?

Thanks in advance,
Chris Received on Wed Jul 30 2008 - 05:23:52 CDT

Original text of this message