jeudi 9 avril 2015

Conditions in access forms

Vote count:


I have a simple SQL query that shows me the workers from a table only in the section "2" from a table with all the workers:

PARAMETERS [Section?] Long;
SELECT Workers.Name, Workers.Age, Workers.Section etc...
FROM Workers
WHERE Workers.Section = [Section?];

It works fine and I generate a form with the query, but in the form I want to put some graphics to show me some stadistics like the age average, number of male and female workers...

First I used this to generate the graphic:

SELECT [Sex],Count([Sex]) FROM [Workers] GROUP BY [Sex];

but it shows me the data from all the workers on the database.

Next I tried to use this:

SELECT [Sex],Count([Sex]) FROM [Workers]
WHERE [Workers.Section] = [Section?] GROUP BY [Sex];

I thought that if the condition was the same it doesn't ask me two times for the same condition.

But it does.

There's any way to use the first condition to generate all the graphics in the form, or ask for a ¿global? condition?

Thanks for your help!

asked 1 min ago

Conditions in access forms

Aucun commentaire:

Enregistrer un commentaire