Query result dependent on value from URL parm

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

I have a query for a page that I am opening that needs the
value being passed to this page via a url parameter to be
the where clause for the query.
Here is what I am trying to do:
Select *
From Employee
Where ID = URL.EMPID

EMPID is the name of the parameter being passed on the URL.

Anybody know how I can do this? Help!
 
If the value is being passed to a query form, store it in a hidden field using the QueryString

<input type="hidden" name="empid" value="<%=Request.QueryString("EMPID")%>">

You can then use it in your SQL (eg. in the DRW it would be Select * From Employee Where ID = ::empid::

If you're using the DRW, it's a little more difficult to pass the value without using a form.
http://home.att.net/~codelibrary/FrontPage/tweaks_p.htm#Passing Query Values
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top