I am using ASP with MS Access Database to create a photo album
there are two tables in the database tblGallery and tblPics each table has the following columns

tblGallery = [galleryID] [galleryName] [galleryDate]
tblPics = [picID] [picCat] [picName]

tblGallery.galleryID = tblPics.picCat in order to create a relational Database and have created the following query for my recordset

SELECT galleryID, picCat, galleryName, galleryDate, picID, picName FROM tblGallery INNER JOIN tblPics ON tblPics.picCat = tblGallery.galleryID

My aim now is to display the recordset in a repeating table but need to remove any records returned with the same galleryID

I have been searching for two days and although I have found a lot of similar issues which suggest using DISTINCT, GROUP BY etc... I have not yet been able to find a solution that works. I am now running out of time for my deadline so any feedback/help would be highly appreciated
Cheers
Kaden712

What are you trying to do?

The idea here is that it returns data where there is only one instance of the galleryID (doesn't matter which one) I then use this as a link to a detail page that dispalys all records for that galleryID (I have got this working fine)
Cheers
Kaden712

If you are not going to show the details in the initial page, you can just retrieve a distinct value of galleryId and then use them to link to detail page.

eg.

SELECT distinct galleryID
FROM tblGallery INNER JOIN tblPics ON tblGallery.galleryID=tblPics.picCat;

Hope this suggestion is of help to you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.