Home » SQL & PL/SQL » SQL & PL/SQL » Re: working with dates
Re: working with dates [message #1820] Sun, 02 June 2002 21:50 Go to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Mahesh is right. Oracle stores also a 'time' part in its date columns. So if you want to use equations, you most likely want to truncate the dates:
SELECT blah_column
  FROM foo
 WHERE <B>TRUNC</B>(date_begin) = <B>TRUNC</B>(sysdate);


HTH,
MHE
Re: working with dates [message #1823 is a reply to message #1820] Sun, 02 June 2002 22:49 Go to previous message
Robin
Messages: 73
Registered: October 2001
Member
Thanks Mahesh & Maaher

I was able to get my data by using the following:

select tickets from cases
where trunc (datecreated) <= trunc (sysdate -5)
and trunc (datecreated >= trunc (sysdate -10);

Thanks for your help!!
Previous Topic: Re: Maximum default value for a DATE in a table?
Next Topic: Difference between UNION ALL and UNION
Goto Forum:
  


Current Time: Fri Apr 26 16:04:59 CDT 2024