Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datetime format in a SQL query

Status
Not open for further replies.

hlauwers

Technical User
Aug 20, 2003
58
BE
Hello all!

I'm attempting to retrieve the records from table X where DAT is greater than 31/12/2004 9am

The WHERE clauses I've tried so far:

WHERE dat > '31/12/2004 9:00:00'
WHERE dat > '31/12/2004 9:00:00 AM'
WHERE dat > '31/12/2004 9:00:00 AM CET'

all return the error ORA-01830: date format picture ends before converting entire input string

What is the correct format to represent Oracle's datetime in SQL?
 
dat in a query result is in format "2003-31-12 06:00:00"


I used the to_date() function, which worked...
but what character is reserved for minutes?

i.e. 'dd/mm/yyyy hh:??:ss am'

thanks
 
Yes - MI. MM was already taken for indicating months.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top