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

Building an expression in a Query 1

Status
Not open for further replies.

coyote1x

Technical User
Dec 10, 2004
7
US
I have built a query that counts the number of Associates that are under a supervisor. The query works great but I want to build an expression to take the total number of associates and multiply them by 10. Does anyone know how to accomplish this. Any help you can provide would be great.



 
Hi. Post your sql and we can change it.

Most likely it will be what ever you wrote with

* 10

added to it.

ChaZ
 
Remember 10*(x+y) = 10x + 10y. If you create a new field TenSum: 10, you can sum that and get the same figure as if you tried to count the items and then multiply by 10.

 
Ok I have tried both ways and now it is asking for a paramater. If I click ok past the paramater it calculates correctly. How do I remove the paramater. Here is the SQL.

SELECT tblSupervisor.SupervisorName, Count(tblAssociate.AssociateID) AS CountOfAssociateID, [CountOfAssociateID]*10 AS Expr1
FROM tblSupervisor INNER JOIN tblAssociate ON tblSupervisor.SupervisorID = tblAssociate.SupervisorID
GROUP BY tblSupervisor.SupervisorName, [CountOfAssociateID]*10;
 
And this ?
SELECT tblSupervisor.SupervisorName, Count(tblAssociate.AssociateID) AS CountOfAssociateID, Count(tblAssociate.AssociateID)*10 AS Expr1
FROM tblSupervisor INNER JOIN tblAssociate ON tblSupervisor.SupervisorID = tblAssociate.SupervisorID
GROUP BY tblSupervisor.SupervisorName;

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

Part and Inventory Search

Sponsor

Back
Top