Home » SQL & PL/SQL » SQL & PL/SQL » next and pervious date
next and pervious date [message #229302] Fri, 06 April 2007 09:57 Go to next message
oracle_coorgi
Messages: 185
Registered: September 2006
Location: INDIA-karnataka
Senior Member
hi
i have stored the date data in varchar2(30) in column name expected_date order_date in proj table
1. i want to get the nearest date of current (next) for expected_date
2. i want to get the nearest date of current (previous) for ordered_date

think today is 05-april-2007
i want for next =06-april-2007
and for previous i want 04-april-2007

thanxs a lot in advance
Re: next and pervious date [message #229303 is a reply to message #229302] Fri, 06 April 2007 10:05 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
>I have stored the date data in varchar2(30) in column
BIG Mistake & you are now paying the price for BAD design.
ALWAYS store dates in DATE data type.
You're On Your Own (YOYO)!
Re: next and pervious date [message #229309 is a reply to message #229302] Fri, 06 April 2007 10:29 Go to previous message
Michel Cadot
Messages: 64108
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Is this not the same question (or about the same) you posted 15 days ago:
http://www.orafaq.com/forum/m/227529/102589/?

Regards
Michel
Previous Topic: How to calculate time difference if not using date datatype
Next Topic: log error feature in 10g
Goto Forum:
  


Current Time: Mon Dec 05 05:13:56 CST 2016

Total time taken to generate the page: 0.27223 seconds