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

calculate

Status
Not open for further replies.

lintow

Programmer
Nov 29, 2004
82
US
I have a problem calculating values

within my table I have 3 fields and 10 records

the first field is the SSN and the second is name and

third is a number value.

The table has duplicate SSN with number values

I want to calculate the value fields from the duplicate SSN to get a total on that SSN number

Example
00001111 Jones 50
00001111 Jones 150
I want to calculate the value field so it would be 200

Does anyone know how to do this
 
Here's some query code for you:

Code:
SELECT TableName.SSN, TableName.PersonName, Sum(TableName.ValueField) AS Total
FROM TableName GROUP BY TableName.SSN, TableName.PersonName

you'll have to tweak with table/field names.

This is called a "Totals" query.

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top