Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

rows number returned by OleDbCommand

$
0
0

ggggg

I have a dbf file- bill.dbf .

name,  endDate,  value--------------------------
john,1/2/2010,25
boni,1/3/2010,75
john,8/4/2009,35
boni,2/2/2010,10
dany,12/2/2009,95

I created a query that give me the latest date for each user whose value is less than 50.
 I don't need the data of the rows. Just rows number returned by this command.

I tried this:

OleDbConnection connection = new OleDbConnection(connectionString);
OleDbCommand cmd1 = new OleDbCommand("Select Count(*)From(SELECT name, MAX(endDate) FROM bill having MAX(value)<50 GROUP BY name) x;", connection);
int no = Convert.ToInt32(cmd1.ExecuteScalar());
But I get a Syntax error in HAVING clause.


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>