Why does my SQL select statement, which includes a date range, not return data from Oracle when using the Database Toolbox?
20 ビュー (過去 30 日間)
古いコメントを表示
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.
採用された回答
MathWorks Support Team
2009 年 9 月 28 日
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Database Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!