Why does my SQL select statement, which includes a date range, not return data from Oracle when using the Database Toolbox?
18 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Why doesn't my select statement return data in Oracle with the Database Toolbox?
I am trying to constrain my data to be between certain dates. When I try my select statement, Oracle returns no data. For example:
sql='select DATE from TABLE where DATE between ''2001-06-28'' and ''2001-06-29'''
curs = exec(conn, sql)
curs=fetch(curs)
returns no data even if my data is between June 28th and June 29th.
Respuesta aceptada
MathWorks Support Team
el 28 de Sept. de 2009
Oracle does not understand the date format you are using and decides that no data matches your SQL statement.
To get Oracle to understand the date, please change the date format to be DD-Month-YYYY. For example:
sql='select DATE from TABLE where DATE between ''28-Jun-2001'' and ''29-Jun-2001'''
curs = exec(conn, sql)
curs=fetch(curs)
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Database Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!