|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Is it possible to use a variable in the SQL query?
<i><b>Originally posted by : Chrisann (Chrisann_odell@bigfoot.com)</b></i><br />I want to use a procedure in ASP which passes a variable into the query, therefore saving precious coding time.<br /><br />eg. SELECT * FROM table WHERE field LIKE 'variable%'<br /><br />I don't even know if this is possible, so any help will be useful. Cheers!<br /><br />Chrisann
|
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : Tim Curtin (tcurtin@nhhartford.com)</b></i><br />If you are using SQL Server:<br />strSQL = "Select * From Table Where Field like " & myvar & "%"<br />If Access,<br />strSQL = "Select * From Table Where Field like " & myvar & "*"<br /><br /><br /><br />------------<br />Chrisann at 4/15/2001 2:56:13 PM<br /><br />I want to use a procedure in ASP which passes a variable into the query, therefore saving precious coding time.<br /><br />eg. SELECT * FROM table WHERE field LIKE 'variable%'<br /><br />I don't even know if this is possible, so any help will be useful. Cheers!<br /><br />Chrisann
|
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Is it possible to use a variable in the SQL query? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|