microsoft access quick question

lockmac

Senior member
Dec 5, 2004
603
0
0
Hey. I am bulding a database and the way it is setup is that I have a table that has the information about my staff member, and another table that contains the dates that they worked and how many hours they worked on that day. How do I make it so in my staff details table, I can have a column that adds up the amount of hours that the staff member worked from the other table?

Thanks
 

Whitecloak

Diamond Member
May 4, 2001
6,074
2
0
If the update has to be real-time, use VBA to sum the values and insert the total into the details table.
 
Nov 7, 2000
16,403
3
81
if you could do that easily, there would be no need for the Excel product :)

like whitecloak said, you can write a VB function to do the math and write back to the table with the sum
you may be able to do it easier with a report (you can have calculated fields in there)
 

KB

Diamond Member
Nov 8, 1999
5,406
389
126
Storing calculated columns in a table violates normal form and shouldn't be done. http://www.bkent.net/Doc/simple5.htm

Do what HardcoreRobot said. Create a report that shows the total hours, by using the SUM(column_name) function in SQL.
 

Whitecloak

Diamond Member
May 4, 2001
6,074
2
0
Originally posted by: KB
Storing calculated columns in a table violates normal form and shouldn't be done. http://www.bkent.net/Doc/simple5.htm

Do what HardcoreRobot said. Create a report that shows the total hours, by using the SUM(column_name) function in SQL.

The Normal forms are a guideline. In real life scenarios, it might be much simpler to not follow the normal forms strictly especially for reporting purposes.