Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Request.QueryString 1

Status
Not open for further replies.
Joined
Mar 17, 2005
Messages
147
Location
US
How can I put a Request.Query String into this sql statement so that my records are filtered by selection?

I want so if your on a list page and you click the link to drill into the details, the details will be filtered for that unique "id"

How could I accomplish this?


SELECT a2.aid, a2.articletitle, a2.shordescrp, a2.imagetitle, a2.image, a2.details, a2.eventdate, a2.datenow, t.commentcount
FROM (SELECT a.aid, COUNT(c.aid) AS commentcount
FROM articles a
LEFT JOIN comments c on a.aid = c.aid
GROUP BY a.aid) t
JOIN articles a2 ON t.aid = a2.aid

STeve
 
Code:
strSQL = "SELECT this, that, theother FROM myTable WHERE id=" & CInt(Request.QueryString("id")) & ";"

assuming id is a number. If its a string then dont use CInt() and surround the value with single quotes

Tony
[red]_________________________________________________________________[/red]
Webmaster -
 
Thanks Fester but I had figured it out just a sec ago.
The glory of this forum is that everyone is so helpful, and it gives you the opp to try to think it through
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top