Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2005

Tip: Looking for answers? Try searching our database.

I need help with a SQL statement

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SailFL - 16 Nov 2005 16:56 GMT
I have a table that has two fields that I want to work with.  The fields are
called Distributors and Group Number.  There are many Distributors and many
Group Numbers.  The Distributors have many listings with the same group.  
There are some Distributors that have no Group Numbers.  I want to create a
list that has the Distributors listed once that have 1 or more Group numbers
associated with them.

Thank you for your help.
Signature

SailFL

OfficeDev18 - 16 Nov 2005 17:29 GMT
SELECT Distributors FROM YourTableName WHERE [Group Numbers] Is Not Null
GROUP BY Distributors;

>I have a table that has two fields that I want to work with.  The fields are
>called Distributors and Group Number.  There are many Distributors and many
[quoted text clipped - 4 lines]
>
>Thank you for your help.

Signature

Sam

John Spencer - 16 Nov 2005 21:08 GMT
SELECT DISTINCT Distributors
FROM YourTable
WHERE [Group number] is not null

>I have a table that has two fields that I want to work with.  The fields
>are
[quoted text clipped - 8 lines]
>
> Thank you for your help.
Sheila D - 16 Nov 2005 22:03 GMT
Hi there

Try something like this:
SELECT Table2.DIstributor, Table2.Group_Number, Count(Table2.Group_Number)
AS CountOfGroup_Number
FROM Table2
GROUP BY Table2.DIstributor, Table2.Group_Number
HAVING (((Count(Table2.Group_Number))>0));

You'll need to replace table and field names as appropriate

HTH

Sheila

> I have a table that has two fields that I want to work with.  The fields are
> called Distributors and Group Number.  There are many Distributors and many
[quoted text clipped - 4 lines]
>
> Thank you for your help.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.