RE: Using q() to define a query



-----Original Message-----
From: Peter J. Holzer [mailto:hjp@xxxxxxxxx]
Sent: Monday, January 14, 2008 1:40 AM
To: dbi-users@xxxxxxxx
Subject: Re: Using q() to define a query

On 2008-01-12 11:54:03 +0100, Dr.Ruud wrote:
"Carville, Stephen" schreef:

and c.certcrtdate >= to_date('%s','MM-DD-YYYY')

Aaargh, you should always use 'YYYY-MM-DD'.

While I prefer YYYY-MM-DD, too (and where is MM-DD-YYYY used, anyway?
Isn't that usually written as MM/DD/YYYY or MM.DD.YYYY?), it doesn't
make a difference here: The string is converted to a date type, and
then two date values are compared. That one of them was computed from
a
string is irrelevant.

That was a legacy format I inherited from the previous web report
writer. He wrote everything as JSP's and apparently someone had taught
him that MM-DD-YYYY was the proper format for dates in Oracle.
Consequently all his SQL and all his web forms used it. I inherited it.

--
Stephen Carville <stephen@xxxxxxxxxxxxxx>
Systems Engineer
Land America
1.626.667.1450 X1326
#####################################################################
Dulce et decorum est pro patria mori.
Si alius est effectus is.

.