Topic: SQL*Plus and PL/SQL >> Date comparision
|
Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property.
You may review the entire Oracle Certification Program Candidate Agreement online Here.
|
|
|
|
| aus |
Posted: Feb 22, 2008 09:16:28 AM |
Total Post: 10
Joined: Dec, 2007
|
Actually i need to get the present system date only without time,then compare that date with the dates stored in the table?
example:
system date is 22/02/08[dd-mm-yy]
and the date in the table is: 22-feb-08 or 22/02/2008.So how to compare this two dates.Because my frontend is java and backend is Ms-Access. |
|
|
Duchi |
| Posted: Feb 22, 2008 01:35:11 PM | |
|
Total Post: 12
Joined: Jan, 2008
|
since you have to compare dates which have different formats the comparison can be done as below
step 1: first convert the sysdate to show only date,
the command to do that is to_date(sysdate) which will return date
step 2: now, convert the sysdate to the format the table has,
the command is to_char(to_date(sysdate),'MM-DD-YYYY')
MM-DD-YYYY is the format of the date stored within the table
Thanks,
Dushyant Reddy
|
|
|
|
|
Duchi |
| Posted: Feb 22, 2008 01:43:14 PM | |
|
Total Post: 12
Joined: Jan, 2008
|
I assumed the format mask to be 'MM-DD-YYYY' in my earlier post. The format mask should have the same format as the date within the table
Thanks,
Duchi
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |
|
|
|
|
Forum Rules & Description
Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user
|
| |
Get FREE Magazines
|
Top 10 Forum User
|
| Murtuja Khokhar | 825 |
| Mohammed Taj | 746 |
| positive fanatic | 483 |
| Jayanta Sur | 479 |
| Vigyan Kaushik | 386 |
| Gitesh Trivedi | 322 |
| Gopu Gopi | 250 |
| neeraj sharma | 245 |
| Ramesh Jois | 245 |
| Bishal Khetan | 207 |
|
|