Syntax for How to Search Between Dates in Oracle
Posted on 2011-09-23
I am attempting to query an Oracle database, and I am new to Oracle syntax. (I am used to MS SQL Server and the local functions for that DBMS.) When I am attempting to search for all transactions that occurred between the dates of 9/1/2011 and 9/5/2011, I am ending up with the error message:
"SQL Error: ORA-00933: SQL command not properly ended
00933. 00000 - "SQL command not properly ended"
The SQL code that I am attempting to use is listed below:
"Select * From results r Where r.txn_date BETWEEN todate('09/01/2011','mm/dd/yyyy') AND todate('09/05/2011','mm/dd/yyyy')"
Any help that could be provided would be greatly appreciated.