Lets say I have three fields in a table. They are:
[SITUSNUM]
[SITUSNAME] and
[STYLE1]
The [SITUSNUM] and [SITUSNAME] fields contain street address values, some of which are duplicates. I would like to have a select query find the unique addresses. Then I would like to generate a count of the values in [STYLE1] for the records in the resulting list.
Thus far, I have figured out how to use SELECT DISTINCT to query a unique list of values, and I know how to use DCOUNT() to count the values in the [STYLE1] field. What I haven't figured out, is how to associate the [STYLE1] with the results of the SELECT DISTINCT query of the other two fields without skewing the results.
I have played around with subqueries a little, as well as querying from another query. Unfortunately, I don't seem to have the syntax and/or have enough understanding of the relationships to achieve what I'm after.
I'm looking for advice, and possible solution. My database design is actually a bit more complicated than what I've presented, but the above should serve to start the discussion.
Thanks!
[SITUSNUM]
[SITUSNAME] and
[STYLE1]
The [SITUSNUM] and [SITUSNAME] fields contain street address values, some of which are duplicates. I would like to have a select query find the unique addresses. Then I would like to generate a count of the values in [STYLE1] for the records in the resulting list.
Thus far, I have figured out how to use SELECT DISTINCT to query a unique list of values, and I know how to use DCOUNT() to count the values in the [STYLE1] field. What I haven't figured out, is how to associate the [STYLE1] with the results of the SELECT DISTINCT query of the other two fields without skewing the results.
I have played around with subqueries a little, as well as querying from another query. Unfortunately, I don't seem to have the syntax and/or have enough understanding of the relationships to achieve what I'm after.
I'm looking for advice, and possible solution. My database design is actually a bit more complicated than what I've presented, but the above should serve to start the discussion.
Thanks!