SELECT *
FROM
Your Table
WHERE
DTM_COLUMN BETWEEN TO_DATE('03-01-2006', 'MM-DD-YYYY') AND TO_DATE('03-17-2006', 'MM-DD-YYYY')+1
By using the +1 you get the data between 3/01 to 3/17
Without the +1 you get the data between 3/01 to 3/16
----
Another hint, if you have any queries like the following, you best fix them before the year rolls over...
SELECT *
FROM
WHERE
TO_CHAR(DTM_COLUMN, 'MM-DD-YYYY') BETWEEN '03-01-2007' AND '03-17-2007'
The above example works fine until you change the start year to 2006...
Oracle can not search TO_CHAR unless it is within the same year...
[ add comment ] ( 5 views ) | permalink |




( 2.9 / 219 )
Calendar


