Re: Problem with result set from a simple SQL Select
Date: 30 Jan 2005 14:03:40 -0800
Message-ID: <41fd59bc_at_news.victoria.tc.ca>
lennyw (lwintfeld_at_libertycorner.net) wrote:
: Thanks for your reply. I'll add the TO_DATE to the query when I get
: back to work on Monday. You're right that a DATE type is not a string;
: it's an integral multiple of milliseconds since <some epoch>.
maybe, maybe not, I wouldn't make assumptions about what it is.
I found
: a website that said there is an implicit cast if a relational is used
: between a parsable date string and a DATE type. But if you think an
: explicit cast is safer, I'll surely go with an expert's advice.
: Thanks again
The default date formats can vary from machine to machine, and can be changed from time to time on the same machine, and for some formats, can be ambiguous and so give you unexpected results.
So yes, if you want to be sure your SQL uses the correct date data then you should always specify the format you are using within your sql (using the to_date function).
I wouldn't exactly call that an issue of being "safer".
-- This space not for rent.Received on Sun Jan 30 2005 - 23:03:40 CET
