Home » SQL & PL/SQL » SQL & PL/SQL » date function
date function [message #20895] Fri, 28 June 2002 03:14 Go to next message
Raju
Messages: 74
Registered: March 1999
Member
Hi

Iam unable to get the output using this query.

select * from prichan where createdt=to_date('28-JUN-02','DD-MON-RR')

if I use the query without where clause all the rows are displaying. what could be the problem.

regards,
raju.
Re: date function [message #20896 is a reply to message #20895] Fri, 28 June 2002 03:27 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
you didnt truncate the HH:mi:ss fields
so, you cannot get a Match.
try this.
select * from prichan where createdt=trunc(to_date('28-JUN-02','DD-MON-RR'))
Re: date function [message #20898 is a reply to message #20895] Fri, 28 June 2002 04:13 Go to previous messageGo to next message
Raju
Messages: 74
Registered: March 1999
Member
hi

Thanks, it is working with my table. But when I use with emp table it is not working why,
select * from emp where trunc(hiredate)=to_date('17-dec-80','DD-MON-RR')
Re: date function [message #20902 is a reply to message #20895] Fri, 28 June 2002 04:21 Go to previous messageGo to next message
Giri Gajjela
Messages: 14
Registered: June 2002
Junior Member
With which query? Mention the query.

Regards,
- Giri Gajjela
Re: date function [message #20957 is a reply to message #20895] Tue, 02 July 2002 18:18 Go to previous message
Koala
Messages: 31
Registered: May 2002
Member
Why don't you try this ??

select * from prichan where to_char(createdt,''DD-MON-RR')='28-JUN-02'
Previous Topic: speed query,urgent
Next Topic: decode
Goto Forum:
  


Current Time: Fri Apr 26 22:19:22 CDT 2024