|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
SELECT statement question...
<i><b>Originally posted by : Brclev (brclev@aol.com)</b></i><br />Is it possible to change the FROM element in a SELECT statement "on the fly"? What I mean is I need the FROM element of the SELECT statement to update depending on what choice is made from a drop-down menu. Is this possible? If so, I would really appreciate some help.<br />-Thanks
|
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : Ramu (ramesh_shetty@yahoo.com)</b></i><br />Yeah , it is possible,<br />Depending on your choice Build an SQL String, then pass that string as Query to the database.It should work fine..<br />All the Best<br /><br />------------<br />Brclev at 8/18/2000 11:21:29 PM<br /><br />Is it possible to change the FROM element in a SELECT statement "on the fly"? What I mean is I need the FROM element of the SELECT statement to update depending on what choice is made from a drop-down menu. Is this possible? If so, I would really appreciate some help.<br />-Thanks
|
|
#3
|
|||
|
|||
|
Dear ....,
It seems your problem is very simple. When ever the user selects the item from the combo box, i am sure you have an id for each item he chooses. So in the subsequent page you can put an IF condition and say like:- combovalue=request.Form("strItems") If combovalue = "1" Then tablename = "customer" ElseIf combovalue = "2" Then tablename = "suppliers" ElseIf combovalue = "3" Then tablename = "Distributor" Else tablename = "orders" End If Query = "select * FROM" + tablename Hope i am able to solve your problems |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > SELECT statement question... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|