Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Compare Oracle Date TIME with sql

Posted on 2008-06-20
3
Medium Priority
?
4,435 Views
Last Modified: 2013-12-18
Experts,

  This is an urgent request. I need compare the colume of datetime type (e.g. 06/21/2008 11:30:00pm) with a timestampe like (e.g 06/21/2008 10:40:35). what is quick way to do that?

select * from mytable
where mydatetime > '06/20/2008 10:40:35pm'
0
Comment
Question by:SarahDeng
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 48

Accepted Solution

by:
schwertner earned 2000 total points
ID: 21836827
select * from mytable
where mydatetime > TO_DATE('06/20/2008 10:40:35pm','mm/dd/yyyy hh:mi:ss pm');
0
 

Author Closing Comment

by:SarahDeng
ID: 31469386
It is quick, easy and working solution! Thanks!!
0
 
LVL 7

Expert Comment

by:Dauhee
ID: 21837251
you can compare them directly in sql if not hardcoding values so:

SELECT  sysdate - SYSTIMESTAMP FROM dual
select * from table where date_col > timestamp_col

http://www.psoug.org/reference/timestamp.html
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question