IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
superk

Global Moderator


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

PostPosted: Thu Oct 08, 2009 6:19 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts Fetch data from programs execute (dat... DB2 3
Search our Forums:

Back to Top