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

simple query

Status
Not open for further replies.

NewStudent

Programmer
Nov 8, 2002
12
0
0
IR
Hi, All,

The following are my queries:

SELECT [Complaints].[mode] AS Category, count([mode])*100/sum([mode]) AS Percentage
FROM Complaints
WHERE [complaints].[mode] Is Not Null
GROUP BY [mode];

I want to get percentage group by 'mode', but it is not work. In this case, the 'mode' 's data type is "text". I try to change the data type for 'mode'that I may lost lot of data.

Any help? Thank you very much.

Rong
 

Try this.

SELECT [Complaints].[mode] AS Category, count([mode])*100./DCount("*", "Complaints","[Mode] Is Not Null") AS Percentage
FROM Complaints
WHERE [complaints].[mode] Is Not Null
GROUP BY [mode];
Terry Broadbent


"The greatest obstacle to discovery is not ignorance -- it is the illusion of knowledge." - Daniel J Boorstin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top