Re: How to query a Date Column in SQL

From: Don Vaillancourt (donv_at_webimpact.com)
Date: 08/19/04


Date: Thu, 19 Aug 2004 15:56:15 -0400

You have to use the TO_DATE function to tell Oracle what your date
format looks like.

For example:

select *
from employee
where hiring_date = to_date('08312004','MMDDYYYY')

Laura P wrote:

> Thanks for the speedy answers!
>
> I can't use to_char, as it is Oracle specific and I need to be able to
> use the same sql for different DB providers.
>
> I have looked up the escape sequence for dates and timestamps
> (http://e-docs.bea.com/wls/docs81/jdbc_drivers/sqlescape.html), and it
> looks like that should do what I need, although I have not tested it
> yet.
>
> Thank you both for your help :)
>
> Laura

-- 
* Don Vaillancourt
Director of Software Development
*
*WEB IMPACT INC.*
phone: 416-815-2000 ext. 245
fax: 416-815-2001
email: donv@web-impact.com <mailto:donv@webimpact.com>
web: http://www.web-impact.com
/ This email message is intended only for the addressee(s)
and contains information that may be confidential and/or
copyright. If you are not the intended recipient please
notify the sender by reply email and immediately delete
this email. Use, disclosure or reproduction of this email
by anyone other than the intended recipient(s) is strictly
prohibited. No representation is made that this email or
any attachments are free of viruses. Virus scanning is
recommended and is the responsibility of the recipient.
/


Relevant Pages

  • RE: DBI->data_sources(Oracle)
    ... As far as I understand DBD::Oracle, ... This E-mail message is for the sole use of the intended recipient ... you are not the intended recipient, please contact the sender by reply ...
    (perl.dbi.users)
  • RE: how to get datatype of columns of a table in perl script
    ... given a valid connect to Oracle: ... the perl script successfully gets rows from oracle database ... PRIVATE COMPANY INFORMATION. ... If you are not an intended recipient of this e-mail, ...
    (perl.dbi.users)
  • RE: Insights into DBI->connect differences
    ... You also should set your oracle environment using the shell script ... the sender of the delivery error by replying to this message, or notify ... This electronic message transmission is a PRIVATE communication which contains ... intended recipient, please be aware that any disclosure, copying, distribution ...
    (perl.dbi.users)
  • Re: Connect to Oracle
    ... Subject: Connect to Oracle ... This electronic message transmission is a PRIVATE communication which ... Please notify the sender of the delivery ... intended recipient, please be aware that any disclosure, copying, ...
    (perl.dbi.users)
  • RE: Connect to Oracle
    ... Subject: Connect to Oracle ... This electronic message transmission is a PRIVATE communication which ... Please notify the sender of the delivery ... intended recipient, please be aware that any disclosure, copying, ...
    (perl.dbi.users)