simon
simon

Reputation: 12912

Oracle: Selecting all records where the table's date fields' hour and minute value are set to certain value

I have a table in a Oracle database containing a date field EXPIRYDATE. I would need to select all records from the table, where the hour and minute portion of the date field are set to 0 (i.e. midnight). How can I achieve this?

I tried with the extract function (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions050.htm), but apparently it only accepts YEAR, MONTH or DAY as parameters for a date field.

Upvotes: 0

Views: 244

Answers (1)

Tony Andrews
Tony Andrews

Reputation: 132660

You could do this:

WHERE TO_CHAR(expirydate,'HH24MI') = '0000'

Upvotes: 5

Related Questions