Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - need some asp help
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

need some asp help

 Post Reply Post Reply
Author
urko View Drop Down
Groupie
Groupie
Avatar

Joined: 23 September 2004
Location: Slovenia
Status: Offline
Points: 160
Post Options Post Options   Thanks (0) Thanks(0)   Quote urko Quote  Post ReplyReply Direct Link To This Post Topic: need some asp help
    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
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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.

Edited by michael - 09 June 2006 at 8:18pm
Back to Top
urko View Drop Down
Groupie
Groupie
Avatar

Joined: 23 September 2004
Location: Slovenia
Status: Offline
Points: 160
Post Options Post Options   Thanks (0) Thanks(0)   Quote urko Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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"
Back to Top
urko View Drop Down
Groupie
Groupie
Avatar

Joined: 23 September 2004
Location: Slovenia
Status: Offline
Points: 160
Post Options Post Options   Thanks (0) Thanks(0)   Quote urko Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.