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 / General 2 / December 2007

Tip: Looking for answers? Try searching our database.

Avoid counting duplicated fields

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pietro - 27 Dec 2007 17:11 GMT
Hi,
  In a query i want to count the field SR (formatted as number),but this
field my be repeated twice or three times,so I want to count every SR one
time only...
Can anybody help?
Ken Sheridan - 27 Dec 2007 17:26 GMT
Count the rows returned by a subquery using the SELECT DISTINCT option, e.g.

SELECT COUNT(*) AS SR_Count
FROM (SELECT DISTINCT SR
            FROM YourTable) AS T1;

You'll find Access will change it a bit after you save it, changing the
parentheses to brackets and adding a dot after the subquery.  It will work
just the same though.

Ken Sheridan
Stafford, England

> Hi,
>    In a query i want to count the field SR (formatted as number),but this
> field my be repeated twice or three times,so I want to count every SR one
> time only...
> Can anybody 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.