I am trying to select data from my Oracle BY DATE database using C #. However, I always get an empty dataset, although the same query string works fine in Oracle SQL Developer
String Query = "Select position_date from position";
OracleDataAdapter adapter = new OracleDataAdapter(Query, ocon);
adapter.Fill(ds, "table");
PrintDataSet(ds);
returns
3/8/2011 12:00:00 AM.... and more
However, when I change my request below, there is no way out!
String Query = "Select position_date from position
where to_char(position_date, 'mm-dd-yyyy') = '05-17-2012'"
This query works fine in oracle sql developer. I also tried trunc (sysdate) but nothing works !: (
source
share