0
I am creating my first application and would like to know how count values of a table in Msaccess with the following conditions:
- "requester" and "Status" must contain specific values;
- If it contains the data
solicitante = solicitante1
andstatus = aberto
, count all values meeting this condition.
I tried something like this but I can’t return values. I tried using COUNT
also.
If anyone can give me a light on how to do the condition test and store the values in a variable. Thanks in advance.
string query7 = " SELECT (Status_Solicitante) from Cartoes where Status_Solicitante='"+"Aberto" + Solic+"'";
command7.CommandText = query7;
OleDbDataReader reader7 = command7.ExecuteReader();
while (reader7 .Read())
{
label11.Text = reader7.ToString();
}
Where do you select the
Status
?– Leonel Sanches da Silva
as I did not know how to evaluate the two fields I put a field where the two fields are joined Status_requester where in this field when the user save it will be filled with the word Abertosolicitante. what I need is to count this field.
– Dênis Suenaga
Can you please put your table here?
– Leonel Sanches da Silva
in the field of the table called Status = Open, Requester = Requester.
– Dênis Suenaga
You just want to count how many records on the table meet your condition, right?
– Jéf Bueno
exactly, I need to know how many records were opened by a particular requester and with open status.
– Dênis Suenaga