Home » SQL & PL/SQL » SQL & PL/SQL » comapre date with sysdate (oralce 10 g)
comapre date with sysdate [message #314071] Tue, 15 April 2008 14:45 Go to next message
miroconnect@yahoo.com
Messages: 202
Registered: April 2006
Senior Member
i have a column with data type date.
I n my select query i have to select rows where sysdate is greate than column date how to ?
i did this is this correct ?
sysdate>to_date(Password_Change_Date,'YYYY-MM-DD')
Re: comapre date with sysdate [message #314078 is a reply to message #314071] Tue, 15 April 2008 15:05 Go to previous messageGo to next message
Michel Cadot
Messages: 64135
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Didn't you say column is of date datatype?
So why do you use to_date function?

Regards
Michel
Re: comapre date with sysdate [message #314082 is a reply to message #314078] Tue, 15 April 2008 15:12 Go to previous messageGo to next message
miroconnect@yahoo.com
Messages: 202
Registered: April 2006
Senior Member
I donot know the right thing can you explain me how to code that
I tried without to_date I did not get rows back .

the value for the column is 8/22/2009 .
Re: comapre date with sysdate [message #314083 is a reply to message #314082] Tue, 15 April 2008 15:16 Go to previous messageGo to next message
Michel Cadot
Messages: 64135
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
the value for the column is 8/22/2009 .

Is this a date or a string?
Post a description of your table.

And isn't 8/22/2009 greater than sysdate? So why should the row be returned?

Regards
Michel
Re: comapre date with sysdate [message #314088 is a reply to message #314083] Tue, 15 April 2008 15:20 Go to previous messageGo to next message
miroconnect@yahoo.com
Messages: 202
Registered: April 2006
Senior Member
the data type is date, i want to see rows which have a date greater than sysdate. I am not sure of comparing sysdate with
the date from my table i need help in comparing my date to sysdate .
Re: comapre date with sysdate [message #314095 is a reply to message #314088] Tue, 15 April 2008 15:26 Go to previous messageGo to next message
Michel Cadot
Messages: 64135
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
i want to see rows which have a date greater than sysdate.

This is not the condition you post above.
Fix that.

Regards
Michel
Re: comapre date with sysdate [message #314102 is a reply to message #314095] Tue, 15 April 2008 15:37 Go to previous messageGo to next message
miroconnect@yahoo.com
Messages: 202
Registered: April 2006
Senior Member
here is my ost

i have a column with data type date.
I n my select query i have to select rows where sysdate is lesser than column date how to ?
i did this is this correct ?
sysdate>to_date(Password_Change_Date,'YYYY-MM-DD')
Re: comapre date with sysdate [message #314111 is a reply to message #314102] Tue, 15 April 2008 15:50 Go to previous messageGo to next message
joy_division
Messages: 4642
Registered: February 2005
Location: East Coast USA
Senior Member
No need for the TO_DATE function here; just leave it out.
Re: comapre date with sysdate [message #314190 is a reply to message #314102] Wed, 16 April 2008 00:44 Go to previous message
Michel Cadot
Messages: 64135
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
select rows where sysdate is lesser than column date

Quote:
sysdate>

Do you see the error?

Regards
Michel
Previous Topic: Problem in passing date as parameter
Next Topic: Incorrect Max(time value) results returned
Goto Forum:
  


Current Time: Thu Dec 08 05:58:18 CST 2016

Total time taken to generate the page: 0.07015 seconds