473,473 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

MS Access Distinct problem!

2 New Member
I need to be able to get rid of the duplicate artists before I count them due to the fact that I will get duplicates in the SQL result window which I don't want. What do I write in order to make this work. I am aware of that distinct gets rid of the duplicates. Can somebody please help me write the syntax for this. I have been trying different solutions which I've found with google but none of them seem to work. I keep getting syntax errors.

SELECT DISTINCT exhibitionname, COUNT(Artist) AS number
FROM Exhibition, ExhibitionTime, Artwork
WHERE Exhibition.ExhibitionID=ExhibitionTime.ExhibitionI D And Artwork.ArtID=ExhibitionTime.ArtID
GROUP BY exhibitionname;

Thanks :)!
Mar 26 '08 #1
1 1723
mshmyob
904 Recognized Expert Contributor
Try something like this.

Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT Count(tblName.fldName) AS CountOffldName1
  2. FROM tblName
  3. ORDER BY Count(tblName.fldName);
  4.  
cheers,

I need to be able to get rid of the duplicate artists before I count them due to the fact that I will get duplicates in the SQL result window which I don't want. What do I write in order to make this work. I am aware of that distinct gets rid of the duplicates. Can somebody please help me write the syntax for this. I have been trying different solutions which I've found with google but none of them seem to work. I keep getting syntax errors.

SELECT DISTINCT exhibitionname, COUNT(Artist) AS number
FROM Exhibition, ExhibitionTime, Artwork
WHERE Exhibition.ExhibitionID=ExhibitionTime.ExhibitionI D And Artwork.ArtID=ExhibitionTime.ArtID
GROUP BY exhibitionname;

Thanks :)!
Mar 26 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Hugh Welford | last post by:
Hi ... using WIN XP/ FP 2000/ IIS. I need to be able to retieve variable length (>255 characters) messages which have been saved in a memo field in an access data base on the server. I am using...
2
by: Paxton | last post by:
Hi, I'm trying to display the total page views per page within a given date range, but the correct SQL is seemingly beyond me. I get the correct result with a straightforward Group By and Count...
14
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB...
4
by: Michael John | last post by:
Dear Oracle Developers, my task is to make up a Oracle View from a Pivot table in MS Access. Given are two tables to join: T_FIRM: FIRM_ABBR VARCHAR2(3 BYTE), FIRM_LONG ...
3
by: Eric Ellsworth | last post by:
Hi all, Does anyone have any bright ideas for Access' tendency to add square brackets when it parses queries, then tell you that the query syntax is invalid. In my case, I'm trying to do a LEFT...
16
by: Rob Geraghty | last post by:
I've just spent some time looking through FAQ sites and searching the google archives of this newsgroup, but I still haven't been able to find a clear explanation of an issue with multi-user...
1
by: nfrodsham | last post by:
In Microsoft's help literature, it states: "You can filter out non-unique rows by using the DISTINCT option of an aggregate function" I am trying to do this in Access 2003 with the COUNT...
22
by: TC | last post by:
I have an Access database application with a lot of custom row functions written in VBA. In other words, a lot of queries contain calculated fields which use functions defined in the modules. I...
5
by: Justin Fancy | last post by:
Hi everyone, I need some help. I'm placing text files into a created database using vb.Net. The problem is that, i need two seperate sql statements to add both files because they are in...
27
by: SQL Learner | last post by:
Hi all, I have an Access db with two large tables - 3,100,000 (tblA) and 7,000 (tblB) records. I created a select query using Inner Join by partial matching two fields (X from tblA and Y from...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.