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 All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Sorting date into YYYYMMDD, and creat... DFSORT/ICETOOL 13
No new posts Sort card to know that creation date ... DFSORT/ICETOOL 10
No new posts Help with SORT - I need to validate d... DFSORT/ICETOOL 11
No new posts Date format correction using dfsort DFSORT/ICETOOL 3
No new posts Sorting Date Field DFSORT/ICETOOL 4
Search our Forums:


Back to Top