I run the string in Oracle SQL developer and i get data howerver when I try to fill the dataset I get 0 rows and 0 columns.
code is as follows:
string from_date = "01/28/2020";
string to_date = "01/29/2020";
string queryString = "SELECT d.materialcode AS MATCODE, m.itemdesc AS ITEMS, sum(d.quantity) AS QUANTITY FROM tbldispensed d " +
"right outer join tblmasterinventory m on m.materialcode = d.materialcode " +
"WHERE TO_DATE(d.datedispensed, 'yy/mm/dd') BETWEEN TO_DATE('"+ from_date + "', 'mm/dd/yyyy') " +
"AND TO_DATE('" + to_date + "', 'mm/dd/yyyy') " +
"GROUP BY d.materialcode, m.itemdesc";
conn.Open();
OdbcDataAdapter da = new OdbcDataAdapter(queryString, conn);
DataSet ds = new DataSet();
da.Fill(ds);
MessageBox.Show(ds.Tables[0].Rows.Count.ToString());
I get 0 rows....can you help please
4 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Daniel RabinovitsPosted Jan 30, 2020, 1:32 PM
Amit GuptaPosted Jan 30, 2020, 11:50 AM
Daniel RabinovitsPosted Jan 30, 2020, 11:25 AM
Amit GuptaPosted Jan 30, 2020, 11:23 AM