This topic is locked
[SOLVED]

 update sum of values to overviewtable

11/22/2009 5:55:54 PM
PHPRunner General questions
S
specpa author

Table Workinghours

WorkinghourID

Workinghour
Table Specification

SpecificationID

Specification
Table Workinghours

ID

User

Specification

WorkingHours
Table Overview

OverviewID

Specification

TotalWorkinghoursPerSpecification

WorkingHoursOriginalEstimation

WorkingHoursResthours=WorkingHoursOriginalEstimation-WorkingHoursOriginalEstimation
The user selects a specification and fills in the corresponding Working hours from a LOV.

I would like to sum the workinghours per specification to TotalWorkinghoursPerSpecification in the existing table Overview,to the corresponding specification field.

How to get this working?
best regards,

Paul Speckens

P
paulwebb 11/22/2009

You don't need (should not) have a table for your Overview, just a View on your data.
'Add View' in 'tables':
Overview
Select

Specification,

Sum(WorkingHours)as TotalWorkinghoursPerSpecification

From WorkingHours

group by Specification
This will make a 'view' that you can use exactly like the table you wanted but should not create.

S
specpa author 11/24/2009



You don't need (should not) have a table for your Overview, just a View on your data.
'Add View' in 'tables':
Overview
Select

Specification,

Sum(WorkingHours)as TotalWorkinghoursPerSpecification

From WorkingHours

group by Specification
This will make a 'view' that you can use exactly like the table you wanted but should not create.


Thanks for the help, I have another question, to explain my question I have added the extra colums in the initial question.

TotalWorkinghoursPerSpecification is a calculated field from the Workinghours

WorkingHoursOriginalEstimation is a estimation per specification and is a number given in by the projectleader (isnt derived from the workinghours)

Is there a way to get the results from
Select

Specification,

Sum(WorkingHours)as TotalWorkinghoursPerSpecification

From WorkingHours

group by Specification
together in a table with the WorkingHoursOriginalEstimation from the Table Overview?