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

Aggregrate Question

Status
Not open for further replies.

darude

Programmer
Jun 23, 2003
138
US
Good afternoon,
I have 4 bit fields in a table and I need to sum each so that the result looks like:

Field1 Field2 Field3 Field4
5 10 15 23

My statement looks like:
SELECT Field1, Field2, Field3, Field4
FROM YTFIntakes
WHERE Year(IntakeDate) = '2008' and AcademicIssues = 1

Thank you in advance.
 
try

SELECT sum(convert(int,Field1)), sum(convert(int,Field2)), sum(convert(int,Field3)), sum(convert(int,Field4))
FROM YTFIntakes
WHERE Year(IntakeDate) = '2008' and AcademicIssues = 1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top