Print Page | Close Window

need some asp help

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=20249
Printed Date: 29 March 2026 at 4:24pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: need some asp help
Posted By: urko
Subject: need some asp help
Date Posted: 09 June 2006 at 7:04pm
I have db with following cells:
- manufacturer
- item

Example:
manufacturer:
1. Test
2. testing
3. Test

As you can see ID 1 and 3 have same name. What I would like is to show records from this table, but ID's with same name would be shown only once.

So that means only ID 1 and 2 should be displayed. Confused

Would need some help with this.

Hope you know what i mean.

Thanks,



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



Replies:
Posted By: michael
Date Posted: 09 June 2006 at 8:17pm

SELECT First(manufacturer.ID), manufacturer.Item
FROM manufacturer
Group by manufacturer.Item


assuming tablename = manufacturer with two cells=item, id


Edit: Forgot to mention, you may want to do an order by ID or so.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: urko
Date Posted: 10 June 2006 at 7:19am
Thanks Smile

now I have another problem

Example
Lets say I have two tables. First table name is Family and second table name is name People.
I have made a releationship in access between 2 tables.

Table 1 has cells:
ID  family      city
1   myfamily    mycity
2   myfamily1  mycity2
3   myfamily2  mycity2

Table 2 has cells:
PID, ID  name       last name         age
1     1    Myname  mylastname        29
2     1    Myname1  mylastname1    29
3     2    Myname2  mylastname 2   29
4     1    Myname3  mylastname3    30

know, lets say you are at page where it show datas datas from table 1 for ID 1.

You also see data age  from table 2 that have same id ( ID 1).

now when you click at age which is a link to detail page, I would like that you would only see datas that have age of 29 and are under ID 1.

I tried several things and it also show me data that has age 30 wehich is also under ID 1.

Thanks.







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


Posted By: michael
Date Posted: 10 June 2006 at 9:19pm
I am not sure I quite understand your question. You would have to pass the age as a parameter. If you just do a "Selct * from table2 where ID=1" then you get all ages of course, but if you do a "Select * from table2 where id=1 and age=29"

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: urko
Date Posted: 11 June 2006 at 7:17am
Thing is that you're at a page where it shows datas form table1.

now, beside table1 I also have another recordset to display datas from table2.

Example:
Table2:
mylastname        29
mylastname        31
mylastname        30

Now this two datas have link to detail page if you want to check how many ppl have age of 29 or how many ppl have same lastname.

So I created a link to search by ID and age.

<a href="detail.asp?ID=<%=(table2.Fields.Item("ID").Value)%>&age=<%=(Table2.Fields.Item("age").Value)%>">Age</a>



<a href="detail.asp?ID=<%=(table2.Fields.Item("ID").Value)%>&lastname=<%=(Table2.Fields.Item("lastname").Value)%>">Last Name</a>


Now when I click on that link, on detail page it shows me all results even the ones that are not age of 29. I would like to limit the search to age only., so that I would get results for age of 29, or if i click on age 30 to get all that are 30 years old, etc..

I hope you know what I mean. Wink


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



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