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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add a calculated field 1

Status
Not open for further replies.

tatika

MIS
Oct 6, 2003
35
US
Hi, hope someone could help me :)
I have a query that holds employee schedule. I created fields such as Employee, Emp _Class, Emp_location, From (time employee loged in), To (time employee loged out), and a calculated field called Total that subtract From and To.

My goal is to find a GrandTotal for each employee. So if an employee works a total of 5 hours per day. I would like to add the employee's time all together in a GrandTotal.

Hope I am being clear enough.

Thanks in advance.
P.S: From and To are formated as medium time. And, field Total is as follow Total: Format([From]-[To],"Short Time")
 
First off - back to datebase theory school. There is no good reason for storing this total in the table. It just wastes memory and increases the potential for data inconsistency errors


To do what you need - use

SELECT Sum([From]-[To]) AS GTotal
FROM tblEmpoyeeRecords
WHERE ( add where clause here )
GROUP BY EmployeeId




'ope-that-'elps.




G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
thanks for the tip.
So that you know, I am not storing the procedure in a table. All of the calculations are stored in a query.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top