dbTalk Databases Forums  

Search between date ranges

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Search between date ranges in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Chris
 
Posts: n/a

Default Search between date ranges - 07-30-2008 , 05:23 AM






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

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.