Count function..how?

tweetysamm

New member
Local time
Today, 19:33
Joined
Nov 22, 2004
Messages
6
Everyone,

Im facing some problem here. Currently im working with a table consist of :

name - text
id - text
buffer - text

1. I will put number '1' into buffer field when the person is coming to work. So my intention is to count how many people is coming to work (whoever with number '1' in buffer field is coming to work)

I manage to solve this by
Select count (*) from table1 where buffer is not null;

the problem is :confused:

2. I want to have the count figure to set it in the table itself so that when i draw out the report will show how many people working on the particular day. But i can do this, does anyone know how to do this? Please give some advice. Thanks a lot :)
 
I would be tempted to expand your Data Structure a little. By all means keep your person table but I would add a table to monitor who is coming in - this will avoid you needing to contantly amending the people table

tblPeople
---------
EmployeeID - Autonumber
EmployeeName - Text

tblWorkers
----------
WorkID - Autonumber
WorkDate - Date
EmployeeID - Number

Create a relatioship between people and workers (One->Many) then you can monitor by date who is working - easier to monitor without needing to use a count query.

hth
 
Insist ~

But my superior do not want to use this step instead he insist want to have everything in a table! Actually i dont know what he thinking also..Any other idea where we can use the count function ?
 
Buffer

Fizzio is absolutely right, with the simple table you have now you cannot keep track. The way you are doing it now would mean that at the end of the time period you will have to print a report, then re-set the buffer field for all employees. That means you will lose the history every time the period expires.
In case you forget to print the report you're in trouble.

I guess you'll have to talk to your superior about this.
 

Users who are viewing this thread

Back
Top Bottom