Link to home
Start Free TrialLog in
Avatar of MaryD
MaryD

asked on

sql using like

I'm using the following sql statement within my program and when it gets to the set option I get incorrect systax error.

qref.sql = "Select * from rates_zones where owner_id = " & ownzip & " zip_postal_code like " & fndnum
I have an option and a text box

If this option then
     take data from text box, along with a specific owner
     find all the record that are like the text box
end if

I have a case statement to add % signs at the end of the text data
ASKER CERTIFIED SOLUTION
Avatar of Jagar
Jagar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MaryD
MaryD

ASKER

Thanks, I looked at that statment but did'nt realize I had to put the single quote. Since I'm using a variable I created a variable for the single quote and added it.

dim qtch as variant
qtch = "''
dim onech as variant
onech = "%"

within case select

fndnum = qtch + numstr + onech + qtch

Thanks again