Contar filas según los parámetros VB.Net

I need to count how many instances or rows there are which have a specific value in one of the columns.

Por Ejemplo:

the column "Ready" is a YES/NO column in Access.

If 5 rows have that set as YES and 7 have it as NO

how do i count how many have yes's and how many have no's

This is mainly for the purposes of statistics

Hope you get what i mean


preguntado el 31 de enero de 12 a las 16:01

2 Respuestas

select ready, count(*)
from a_table
group by ready

Respondido el 31 de enero de 12 a las 20:01

Assuming you already filled a datatable?

 Dim YesRows As Integer = MyTable.Rows.Count(Function(r) r("Ready") = 1)

Respondido el 31 de enero de 12 a las 20:01

How do i link this with MS Access? - i have a DB connection string just not sure how to use it with this - Dr Pepper

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.