?
Solved

sql using like

Posted on 1998-07-28
2
Medium Priority
?
123 Views
Last Modified: 2010-05-03
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
0
Comment
Question by:MaryD
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
Jagar earned 200 total points
ID: 1466951
Your like statement should look like this

SELECT * FROM TABLE WHERE FIELD Like '%data%'

Notice the '
0
 

Author Comment

by:MaryD
ID: 1466952
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
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month10 days, 16 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question