Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SQL*Plus Oracle SQL - Retrieve a Row for Today's Date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Oct 08, 2009 6:19 pm    Post subject: SQL*Plus Oracle SQL - Retrieve a Row for Today's Date
Reply with quote

I'm writing a SQL query for an Oracle database. I want to select only the rows from a table that were created today.

The field name is CREATION_DATE. Running a DESCRIBE for the table, it tells me that the field is NOT NULL TIMESTAMP(6).

The data in that field is in the format DD-MON-YY HH.MM.SS.NNNNNN AM/PM.

So, how do I code the SELECT statement to retrieve only the rows with the CREATION_DATE of today?

Update:Select rows older than the past 15 minutes

Code:

SELECT ..... CREATION_DATE FROM TBL
WHERE SYSTIMESTAMP - CREATION_DATE > TO_DSINTERVAL ('-0 05:15:00');
Back to top
View user's profile Send private message

View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Add system date inside of a PS file a... pramitdas DFSORT/ICETOOL 5 Sun Aug 28, 2016 12:06 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us