[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] wrote:
> 
> The column 'START' is of type DATE.
> 
> Surely if one sets the date format with NLS_DATE_FORMAT, you SHOULDN'T
> need to use other functions like TRUNC?

No.  When you perform a date comparison, the string is converted to a date,
using the NLS_DATE_FORMAT, rather than the other way around.


Your SQL is equivalent to:

SELECT * FROM my_table WHERE start = TO_DATE('08-09-1999', 'DD-MM-YYYY')

which is not the same as:

SELECT * FROM my_table WHERE TO_CHAR(start, 'DD-MM-YYYY') = '08-09-1999'

because, as Ron said, the former won't match if the value in start includes
a time component.


It worked when you used LIKE instead of =, because LIKE forces a string
comparison rather than a date comparison.


Ronald


Reply via email to