Database Administration (MOSC)

MOSC Banner

How to SELECT the Time from a DATETIME Field?

edited Dec 28, 2009 2:51PM in Database Administration (MOSC) 13 commentsAnswered
  I need some help with a query. I want to select all the rows in a DateTime column that do not have a "time" value with the date. In other words, the column name is "datetime", the values in this column would be in the for of, e.g., "14-DEC-09 08:12:21 PM".

I've tried several queries, including the following, but returns 0 records:

SELECT TO_CHAR(date_time, 'hh:mi:ss PM')
FROM fault_events
WHERE to_char(date_time, 'hh:mi:ss PM') IS NULL


When running the following query:

SELECT date_time
FROM fault_events
WHERE date_time LIKE '03-JUL-09'

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center