Re: How to query a Date Column in SQL
From: Don Vaillancourt (donv_at_webimpact.com)
Date: 08/19/04
- Next message: Tung Chau: "PLEASE HELP! Tomcat and Hibernate ServletException, net/sf/cglib/core/KeyFactory problem"
- Previous message: Don Vaillancourt: "Re: Select Distinct"
- In reply to: Laura P: "Re: How to query a Date Column in SQL"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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. /
- Next message: Tung Chau: "PLEASE HELP! Tomcat and Hibernate ServletException, net/sf/cglib/core/KeyFactory problem"
- Previous message: Don Vaillancourt: "Re: Select Distinct"
- In reply to: Laura P: "Re: How to query a Date Column in SQL"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|