Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two Table Caluculation Trouble 1

Status
Not open for further replies.
Jun 18, 2002
126
US
I have two tables (code and employee). They have a one-to-many relationship, respectivly. In employee there is a status field representing active or terminiated with an A or T. In the code table there are two fields (active and terminiated) with the number amount for each codeID. How do I calculated these #'s based on the A and T's, and update the code table with the employee table information as it is entered? Also, is it possible to have a T automatically placed in the status colum whan a termination date is entered?
Thanks for any help!!
Melissa
 
Do not store calculated results in your table. Not only is this unnecessary, it can potentially be innaccurate. Instead, use a query to calculate the totals on demand. Base a query on the employee table. Add the status field to the QBE grid twice (put two copies on the grid). Press the sum button on the toolbar. Leave one of the copies Total property as Group By and change the other total property to Count. "Advice is a dangerous gift, even from the wise to the wise, for all course may run ill." J.R.R. Tolkien
 
I don't think you would need your code table modified. Is it just a table for job types or something? You said you have a 1:N relationship which leads me to believe so.

So each code can have many employees with that code? If that's the case, then codes would not have an A or T status.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top