I need the logic behind date syntax

Reply

Join Date: Sep 2008
Posts: 3
Reputation: sunny101 is an unknown quantity at this point 
Solved Threads: 0
sunny101's Avatar
sunny101 sunny101 is offline Offline
Newbie Poster

I need the logic behind date syntax

 
0
  #1
Sep 25th, 2008
Can someone let me know how the date syntax work. example working with "greatest" 01-oct-02 and 20-may-2003, it accept 20-may-2003 to be the greatest instead of 01-oct-02 which the oldest (greatest) can someone explain this to me. please let me know the logic behind. I have alot of problems with this.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 11
Reputation: yogesh_vaidya12 is an unknown quantity at this point 
Solved Threads: 1
yogesh_vaidya12 yogesh_vaidya12 is offline Offline
Newbie Poster

Re: I need the logic behind date syntax

 
0
  #2
Sep 25th, 2008
You Have to use Date Fromat To_Date
('20-may-2003','dd-mon-yyyy') and to_date('01-oct-2002','dd-mon-yyyy')
and you find between this greatest.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 3
Reputation: sunny101 is an unknown quantity at this point 
Solved Threads: 0
sunny101's Avatar
sunny101 sunny101 is offline Offline
Newbie Poster

Re: I need the logic behind date syntax

 
0
  #3
Sep 26th, 2008
Originally Posted by yogesh_vaidya12 View Post
You Have to use Date Fromat To_Date
('20-may-2003','dd-mon-yyyy') and to_date('01-oct-2002','dd-mon-yyyy')
and you find between this greatest.
thank you for your support, but i tried the syntax you sent to me, it will only show the appearance of the date dd mm yy.

when oracle tries to compare the two date to see the one that is oldest, because one have to come before the other everyone it is known that '01-oct-2002' will come first before '20-may-2003' just a mere look. But oracle does not work like that, it works differently try comparing the dates using the greatest function. you see what i am talking about. i want to know the logic.
Last edited by sunny101; Sep 26th, 2008 at 1:09 am.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 9
Reputation: like_to_learn is an unknown quantity at this point 
Solved Threads: 0
like_to_learn's Avatar
like_to_learn like_to_learn is offline Offline
Newbie Poster

Re: I need the logic behind date syntax

 
0
  #4
Dec 10th, 2008
why can't you use 'least' function to get the oldest(Greatest) date.....
your requirement is to get Greatest(Oldest) date right?,So you can use "least" function instead of "greatest" function..........
I think it will help you ..........................
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Oracle Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC