Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Syntax for: Average of  Field values

Posted on 2009-07-08
2
Medium Priority
?
217 Views
Last Modified: 2012-05-07
Hi Experts

I have a client database, which holds records of client data including their purchase rates (ie transactions per year). Now I'd like to determine the average Purchase rate for the whole group of clients.

Can a sql be written to calculate the average??? ( or do i need to set up a loop, add each purchase rate and the divide by the nr of clients)

eg (VB6, Access 2003 database)
Client_Id     Client_PurchaseRate

sql = "Select distinct Client_ID from CLIENT_DETAILS "
?Sql .......determine average rate  ????

Set dsClients = CURDB.OpenRecordset (sql, dbOpenDynaset)

0
Comment
Question by:peterdarazs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 17

Accepted Solution

by:
pssandhu earned 2000 total points
ID: 24810946
Select ClientID, AVG(PurchaseRate) AvgRate
From   Client_Details
Group by CLientID
This is in MS Sql Server syntax.
P.
0
 

Author Closing Comment

by:peterdarazs
ID: 31601433
Ok, thanks , that 'll help a lot....
P
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question