Print Page | Close Window

distinct problem

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=28286
Printed Date: 28 March 2026 at 12:37pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: distinct problem
Posted By: urko
Subject: distinct problem
Date Posted: 27 January 2010 at 1:25pm
Hi,

Not sure why Distinct is not working in my RS.  Im using ms access with query table to display more items


BrandCat = Request.QueryString("IdCategory")
mySQL = "SELECT Distinct Name, " _
        & "IdCategory, IdParentCategory, idBrand " _
        & "FROM Sorting " _
        & "WHERE    IdParentCategory = " & BrandCat & " " _
        & "ORDER BY Name ASC"





-------------
Urko



Replies:
Posted By: dpyers
Date Posted: 27 January 2010 at 3:53pm
Name is a reserved word

-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: urko
Date Posted: 27 January 2010 at 4:02pm
Yea i know. :) but this is candypress estore so i'm just playing along :)...It actually worked on other RS that i have in different page, but here it shows me same record names several time.

-------------
Urko


Posted By: godeep
Date Posted: 31 January 2010 at 4:45am
Im not a pro, but just a thought. Im not sure of the table setup in the DB, but it may be a string to int issue. worth a shot.
 
You may try this.
 
mySQL = "SELECT Distinct Name, " _
        & "IdCategory, IdParentCategory, idBrand " _
        & "FROM Sorting " _
        & "WHERE    IdParentCategory LIKE '"&BrandCat&"' " _
        & "ORDER BY Name ASC"



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net