[Solved] How to count the number of rows in a table with a condition? C# ACCESS


Use the correct formatting of a string expression for a date value:

string Query = "Select Count(*) FROM SALES WHERE [DATE] = #" + DateTime.Today.ToString("yyyy"https://stackoverflow.com/"MM"https://stackoverflow.com/"dd") +"#";

Or, simpler, use the function of Access:

string Query = "Select Count(*) FROM SALES WHERE [DATE] = Date()";

0

solved How to count the number of rows in a table with a condition? C# ACCESS