Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 4650
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 Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us