Re: How to count same value as 1 in a query
- From: Fernando@Sartorius <FernandoSartorius@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 18 Mar 2009 10:31:36 -0700
Michel, I was able to understand what you were trying to explain to me in SQL
code by reading the data out of SQL View (sorry, I'm a newb). Still, the
product of your data gives me the same as creating a count of products, but
what I need is the amount of days that this product was actually bought in,
disregarding the actual amount of products sold.
"Michel Walsh" wrote:
Make a query that will group by product AND by date, next, make a second.
query that will be based on the previous query, but this last query will
group by product and count the number of records:
q1:
SELECT product, theDate
FROM somewhere
GROUP BY product, theDate
q2:
SELECT product, COUNT(*)
FROM q1
GROUP BY product
Vanderghast, Access MVP
"Fernando@Sartorius" <Fernando@Sartorius@discussions.microsoft.com> wrote in
message news:457FC0FE-9002-475D-824F-BCA80469D930@xxxxxxxxxxxxxxxx
Good day to all who read this post. I am in need of assistance. I am
trying
to create a query in which I need to state that This X Material was
purchased
Y amount of times during a year, but if the products was bought multiple
days, I want the query to count all those values from that same date as 1.
These are my Fields:
Mat 1st Date Purch. Last Day Purch. # of times bought # of days
product was bought.
Can anyone provide me some feedback? Thanks in advanced.
- Follow-Ups:
- Re: How to count same value as 1 in a query
- From: Michel Walsh
- Re: How to count same value as 1 in a query
- References:
- How to count same value as 1 in a query
- From: Fernando@Sartorius
- Re: How to count same value as 1 in a query
- From: Michel Walsh
- How to count same value as 1 in a query
- Prev by Date: RE: Multiple Listings to Single Line
- Next by Date: Re: Deleting Duplicate Records in a Query
- Previous by thread: Re: How to count same value as 1 in a query
- Next by thread: Re: How to count same value as 1 in a query
- Index(es):
Relevant Pages
|