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.

hp

--
_ | Peter J. Holzer | If I wanted to be "academically correct",
|_|_) | Sysadmin WSR | I'd be programming in Java.
| | | hjp@xxxxxxxxx | I don't, and I'm not.
__/ | http://www.hjp.at/ | -- Jesse Erlbaum on dbi-users

Attachment: pgp2S8W4Bi8vc.pgp
Description: PGP signature



Relevant Pages

  • Re: Terminolgy: the verb corresponding to "toString"
    ... /** returns date converted to an ISO date String of the form ... YYYY-MM-DD in local time. ... > @param theDate date you want to display. ...
    (comp.lang.java.programmer)
  • Re: Date Conversion
    ... I recommend making a string of it MM/DD/YYYY: ... >converts dates to a text data field in the format of ... >How can I convert the text data into a date format in ...
    (microsoft.public.access.queries)
  • Re: ASP > SQL date problem!?
    ... the general accepted format is yyyy-mm-dd ... I do not use SQL server. ... But if you 'give' it to the db as a ASP string, ...
    (microsoft.public.inetserver.asp.general)
  • Re: ASP > SQL date problem!?
    ... the general accepted format is yyyy-mm-dd ... I do not use SQL server. ... But if you 'give' it to the db as a ASP string, ...
    (microsoft.public.access.adp.sqlserver)
  • RE: DateTime format during INSERT using MS JDBC driver
    ... You can thus convert the "yyyy-mm-dd" string to Date. ... use CONVERT function to convert the string to a datetime sql data type ... according to the proper style of date format. ...
    (microsoft.public.sqlserver.jdbcdriver)