A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query help



 
 
Thread Tools Display Modes
  #1  
Old May 27th, 2004, 07:58 PM
Steve
external usenet poster
 
Posts: n/a
Default Query help

Hello,

I have imported a databae into access. Essentially I have
a database of names and addresses. all of the names in
the databae have multiple records with the same names but
different addresses. What I am trying to do is get a
report of records based on how many times there name
appears in the database. For example I want a report for
anyone whos name appears in the database 3 or more times
or 5 or more times etc.

so i might have a set of records like this

Joe A 123 main street
Joe A 123 main street
Joe A 123 main street
joe A 123 main street
joe B 555 west street
Joe C 142 north street
Joe C 123 north street
Joe C 123 north street
Joe C 123 north street
Joe C 123 north street
Joe D 222 south lane
Joe D 222 south lane

I want to get a list of anyone with more than 3 records
in the database.
Hope this is clear and thank you for any help
S
  #2  
Old May 27th, 2004, 08:41 PM
Gerald Stanley
external usenet poster
 
Posts: n/a
Default Query help

The following returns all names that appear in more than 3
rows in a table. You should be able to amend it to achieve
your result.

SELECT nameColumn
FROM MyTable
GROUP BY nameColumn
HAVING Count(1) 3

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
Hello,

I have imported a databae into access. Essentially I have
a database of names and addresses. all of the names in
the databae have multiple records with the same names but
different addresses. What I am trying to do is get a
report of records based on how many times there name
appears in the database. For example I want a report for
anyone whos name appears in the database 3 or more times
or 5 or more times etc.

so i might have a set of records like this

Joe A 123 main street
Joe A 123 main street
Joe A 123 main street
joe A 123 main street
joe B 555 west street
Joe C 142 north street
Joe C 123 north street
Joe C 123 north street
Joe C 123 north street
Joe C 123 north street
Joe D 222 south lane
Joe D 222 south lane

I want to get a list of anyone with more than 3 records
in the database.
Hope this is clear and thank you for any help
S
.

  #3  
Old May 27th, 2004, 09:16 PM
external usenet poster
 
Posts: n/a
Default Query help

Appreciate the quick reply and help!!!
It looks like what I want to do, but I have am elementary
question..... Where do I put this information? I tried
putting it on the criteria line (inserted my real field
name and table name) in the query design view but it does
not work. Obviously I am a novice with access. I
appreciate your help .
-----Original Message-----
The following returns all names that appear in more than

3
rows in a table. You should be able to amend it to

achieve
your result.

SELECT nameColumn
FROM MyTable
GROUP BY nameColumn
HAVING Count(1) 3

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
Hello,

I have imported a databae into access. Essentially I

have
a database of names and addresses. all of the names in
the databae have multiple records with the same names

but
different addresses. What I am trying to do is get a
report of records based on how many times there name
appears in the database. For example I want a report

for
anyone whos name appears in the database 3 or more

times
or 5 or more times etc.

so i might have a set of records like this

Joe A 123 main street
Joe A 123 main street
Joe A 123 main street
joe A 123 main street
joe B 555 west street
Joe C 142 north street
Joe C 123 north street
Joe C 123 north street
Joe C 123 north street
Joe C 123 north street
Joe D 222 south lane
Joe D 222 south lane

I want to get a list of anyone with more than 3 records
in the database.
Hope this is clear and thank you for any help
S
.

.

  #4  
Old May 27th, 2004, 09:17 PM
Kevin Sprinkel
external usenet poster
 
Posts: n/a
Default Query help

Do a Totals query (View, Totals from Query Design view).
Select the Name field (or the PK that refers to the name)
and any other field. Group By the name, and enter Count
for the other.

Add the criteria =3 to the field being counted.

HTH
Kevin Sprinkel


-----Original Message-----
Hello,

I have imported a databae into access. Essentially I have
a database of names and addresses. all of the names in
the databae have multiple records with the same names but
different addresses. What I am trying to do is get a
report of records based on how many times there name
appears in the database. For example I want a report for
anyone whos name appears in the database 3 or more times
or 5 or more times etc.

so i might have a set of records like this

Joe A 123 main street
Joe A 123 main street
Joe A 123 main street
joe A 123 main street
joe B 555 west street
Joe C 142 north street
Joe C 123 north street
Joe C 123 north street
Joe C 123 north street
Joe C 123 north street
Joe D 222 south lane
Joe D 222 south lane

I want to get a list of anyone with more than 3 records
in the database.
Hope this is clear and thank you for any help
S
.

  #5  
Old May 27th, 2004, 09:23 PM
external usenet poster
 
Posts: n/a
Default Query help

I wrote too soon. I figured it out on my own . PLease
disregard. Thanks again for your help
S
-----Original Message-----
Hello,

I have imported a databae into access. Essentially I

have
a database of names and addresses. all of the names in
the databae have multiple records with the same names

but
different addresses. What I am trying to do is get a
report of records based on how many times there name
appears in the database. For example I want a report for
anyone whos name appears in the database 3 or more times
or 5 or more times etc.

so i might have a set of records like this

Joe A 123 main street
Joe A 123 main street
Joe A 123 main street
joe A 123 main street
joe B 555 west street
Joe C 142 north street
Joe C 123 north street
Joe C 123 north street
Joe C 123 north street
Joe C 123 north street
Joe D 222 south lane
Joe D 222 south lane

I want to get a list of anyone with more than 3 records
in the database.
Hope this is clear and thank you for any help
S
.

  #6  
Old May 27th, 2004, 10:11 PM
Gerald Stanley
external usenet poster
 
Posts: n/a
Default Query help

I would probably get the sequence wrong if I tried to
explain it in the Design View. From the query design view,
select View-SQL View to see the underlying SQL, make the
changes to my SQL to suit your database, then switch back
to Design View to see how it looks.

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
Appreciate the quick reply and help!!!
It looks like what I want to do, but I have am elementary
question..... Where do I put this information? I tried
putting it on the criteria line (inserted my real field
name and table name) in the query design view but it does
not work. Obviously I am a novice with access. I
appreciate your help .
-----Original Message-----
The following returns all names that appear in more than

3
rows in a table. You should be able to amend it to

achieve
your result.

SELECT nameColumn
FROM MyTable
GROUP BY nameColumn
HAVING Count(1) 3

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
Hello,

I have imported a databae into access. Essentially I

have
a database of names and addresses. all of the names in
the databae have multiple records with the same names

but
different addresses. What I am trying to do is get a
report of records based on how many times there name
appears in the database. For example I want a report

for
anyone whos name appears in the database 3 or more

times
or 5 or more times etc.

so i might have a set of records like this

Joe A 123 main street
Joe A 123 main street
Joe A 123 main street
joe A 123 main street
joe B 555 west street
Joe C 142 north street
Joe C 123 north street
Joe C 123 north street
Joe C 123 north street
Joe C 123 north street
Joe D 222 south lane
Joe D 222 south lane

I want to get a list of anyone with more than 3 records
in the database.
Hope this is clear and thank you for any help
S
.

.

.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:15 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.