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

SELECT SUM(pointsrecvd) FROM (SELECT DISTINCT)... 1

Status
Not open for further replies.

daveigh

Programmer
Oct 9, 2003
105
0
0
i have this sql string:

SELECT SUM(pointsrecvd) FROM (SELECT DISTINCT userid FROM tblPointSystem)

wherein i have to get the sum of column pointsrecvd from distinct userids of table tblPointSystem. But i get this error:

Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.

can you guys help me out here? thanks!

______________CRYOcoustic_____________
 
Code:
SELECT SUM(pointsrecvd),userid
 FROM tblPointSystem
group by userid
 
tnx swamp. one last thing, is there a way I can sort the listed records by the sum of POINTSRECVD? i tried adding "order by" but i got this error:

Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.

really appreciate your help, dude. =)

______________CRYOcoustic_____________
 
Code:
SELECT SUM(pointsrecvd),userid
 FROM tblPointSystem
group by userid
order by 1 desc

1 reflects the position in the select list of the item you wish to order by.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top