Skip to main content
Inspiring
September 13, 2006
Answered

Filter by group

  • September 13, 2006
  • 1 reply
  • 294 views
Hello everybody

Is there anyway that I can create a link to an Access database that will display records filtered in groups where the filters will be variables? I was thinking of a link something along the lines of ' filename.asp?firstVar secondVar' for the link and then some form of SQL query on the page holding the recordset.

Any ideas?

Martin
This topic has been closed for replies.
Correct answer i_hitman
Yep, so if your url read...

filename.asp?firstvar=1&secondvar=2

...you could build this into your SQL using the Request.QueryString command, eg.

SQL = "SELECT * FROM yourTable WHERE Field1='" & Request.QueryString("firstvar") & "' AND Field2='" & Request.QueryString("secondvar") & "'"

If you're using the Dreamweaver recordset builder, you'd enter a suitable name for the criteria value in the SQL window and then create the variables in the variable window with the values as Request.QueryString("firstvar") etc.

1 reply

i_hitmanCorrect answer
Participating Frequently
September 13, 2006
Yep, so if your url read...

filename.asp?firstvar=1&secondvar=2

...you could build this into your SQL using the Request.QueryString command, eg.

SQL = "SELECT * FROM yourTable WHERE Field1='" & Request.QueryString("firstvar") & "' AND Field2='" & Request.QueryString("secondvar") & "'"

If you're using the Dreamweaver recordset builder, you'd enter a suitable name for the criteria value in the SQL window and then create the variables in the variable window with the values as Request.QueryString("firstvar") etc.
PantyboyAuthor
Inspiring
September 15, 2006
Thanks!

Works like a dream!

M