G
Guest
Hello,
What would be the SQL to return the following ?
I have a table called tblContracts. Each Contract has a ContractValue.
For each Contract I want to return the ContractNumber, ContractValue & the
Average of all the ContractValues. See example:
ContractNumber ContractValue AvgContractValue
-------------------------------------------------------
1 10.00
10.00
2 15.00
10.00
3 5.00
10.00
I tried:
SELECT ContractNumber, ContractValue, Avg(ContractValue)
FROM tblContracts
But I can an error "You tried to execute a Query that does not include the
specified expression 'ContractNumber' as part of an aggregate function"
Any help would be greatly appreciated.
Thank you,
Jeff
What would be the SQL to return the following ?
I have a table called tblContracts. Each Contract has a ContractValue.
For each Contract I want to return the ContractNumber, ContractValue & the
Average of all the ContractValues. See example:
ContractNumber ContractValue AvgContractValue
-------------------------------------------------------
1 10.00
10.00
2 15.00
10.00
3 5.00
10.00
I tried:
SELECT ContractNumber, ContractValue, Avg(ContractValue)
FROM tblContracts
But I can an error "You tried to execute a Query that does not include the
specified expression 'ContractNumber' as part of an aggregate function"
Any help would be greatly appreciated.
Thank you,
Jeff