Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

sql using like

Posted on 1998-07-28
2
Medium Priority
?
126 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

604 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