select * from table where date between

What is the correct syntax of the sql
statement that lets me select a record
in which the dates are out of the condition


I would like to use between clause that
will set starting date and ending date
and everything out of the condition should be selected.

SELECT * FROM TABLE_NAME WHERE STARTDATE
NOT BETWEEN (to_date('12/01/1999','mm/dd/yyyy') and to_date('12/31/1999','mm/dd/yyyy'))


Is this correct?

Thanks.
Info_user100Asked:
Who is Participating?
 
sudhi022299Connect With a Mentor Commented:
well you got the between operator right, but the braces were wrong.

I feel it should be:
select * from table_name where startdate not between to_date('12/01/1999','mm/dd/yyyy') and to_date('12/31/1999','mm/dd/yyyy');

if you use the between operator , then it is inclusive of the values that u provide. But NOT BETWEEN is exclusive.

Regards,
Sudhi.
0
All Courses

From novice to tech pro — start learning today.