Queries Confusion

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I'm trying to write a querie for a database that lists several clients by
a unique id number. I'd like to see how many of the clients have purchased
over $500 of services from us, but I'm running into a brick wall with my
logic. Because each person can purchase at different times, I need to be
able to list the total they have spent based on their id number, but I can't
get the logic to work with the total of their purchases, only on individual
purchases. So if they have 3 purchases that add up to over $500, they aren't
appearing in my report, but if they have 1 purchase over $500, they turn up.
How do I make the query look at the total of their purchases as opposed to
the total of each purchase. I'm using Access 97. Thanks in advance.
 
Hi, I'm trying to write a querie for a database that lists several clients by
a unique id number. I'd like to see how many of the clients have purchased
over $500 of services from us, but I'm running into a brick wall with my
logic. Because each person can purchase at different times, I need to be
able to list the total they have spent based on their id number, but I can't
get the logic to work with the total of their purchases, only on individual
purchases. So if they have 3 purchases that add up to over $500, they aren't
appearing in my report, but if they have 1 purchase over $500, they turn up.
How do I make the query look at the total of their purchases as opposed to
the total of each purchase. I'm using Access 97. Thanks in advance.

Run a Total's query.
It will look something like this.

SELECT tblBasicData.ID, Sum(tblBasicData.ANumber) AS SumOfANumber
FROM tblBasicData
GROUP BY tblBasicData.ID
HAVING (((Sum(tblBasicData.ANumber))>500));
 
Back
Top