473,406 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

using wildcard character in query

i created a list box and text box with a command button below
the txt box is used to find info in the list box . i created a sql stament that does this. however i would like to create a wild card where if someone enters caracters from a-z it will pull up a record. below is my current sql statement


SQL = "SELECT LWFieldKey, LWTableLink, LWTableName, [LWFieldName_4], [Field Description] " & _
"FROM LWTABLES INNER JOIN LWFIELDS ON " & _
"LWTABLES.LWTableKey = LWFIELDS.LWTableLink " & _
"WHERE [LWFieldName_4] = '" & txtlwField & "' OR " & _
"[Field Description] = '" & txtlwDescription & "'"
Mar 8 '07 #1
2 9435
ronverdonk
4,258 Expert 4TB
however i would like to create a wild card where if someone enters caracters from a-z it will pull up a record.
I suppose you mean a wildcard character like an asterisk (*).
In a MySQL query you can use the LIKE attribute. E.g.

Expand|Select|Wrap|Line Numbers
  1. # Search for all records with field starting with chars ABC
  2. SELECT * FROM table WHERE field LIKE 'ABC%'
  3. # Search for all records with field containing ABC
  4. SELECT * FROM table WHERE field LIKE '%ABC%'
  5. # Search for all record with field ending with ABC
  6. SELECT * FROM table WHERE field LIKE '%ABC
When you are interested you could also use a regular expresion.

Ronald :cool:
Mar 8 '07 #2
dlite922
1,584 Expert 1GB
I suppose you mean a wildcard character like an asterisk (*).
In a MySQL query you can use the LIKE attribute. E.g.

Expand|Select|Wrap|Line Numbers
  1. # Search for all records with field starting with chars ABC
  2. SELECT * FROM table WHERE field LIKE 'ABC%'
  3. # Search for all records with field containing ABC
  4. SELECT * FROM table WHERE field LIKE '%ABC%'
  5. # Search for all record with field ending with ABC
  6. SELECT * FROM table WHERE field LIKE '%ABC
When you are interested you could also use a regular expresion.

Ronald :cool:
I was curious, could you use the wild character with the IN() match.

For example could you do

WHERE name IN ("Tho%","%Mc%")

I tried it and it didn't work, is it LIKE IN ( ) or something?
Jun 29 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: D | last post by:
Dear all, if in asp. i wanna to use the command request.querystring to check the URl. For example, my item when passing to next form will be either 4 or 6 character. How do i tell asp what to do if...
4
by: Lucky | last post by:
I have a vb.net windows app that connects to an access database. The database has 1 table. One of the columns is called "Address". A user enters any address into a textbox (txtValue) then clicks...
1
by: deko | last post by:
I have a form where users can enter a string with asterisks to perform a wildcard search. Currently, the string entered by the user looks like this: *somestring* The purpose is to match any...
1
by: Law.Win | last post by:
I have an IIF statement in the criteria of a query. I would like to know how to use a wildcard with the varaibles inside it. For example IIF(, , ) I would like the wildcard after variable 2. ...
2
by: deko | last post by:
I'm trying to use a textbox to search and display records as each letter is typed in - similar to the behavior of a combo box. But for some reason I can't seem to get the wildcard search character...
1
by: Bruce Lawson | last post by:
Hi, I am confused about Microsofts description of this Transact SQL reference; (Wildcard - Character(s) to Match. The description says "Matches any single character within the specified range or...
10
by: Robert | last post by:
How do you get an accurate count of the number of records returned from a query when using linked tables. I have an access 2003 database as a front end to another access 2003 database that...
1
by: Lucvdv | last post by:
In my assembly.vb files, I'm using the revision/build wildcard style: <Assembly: AssemblyVersion("3.0.*")> <Assembly: AssemblyFileVersion("3.0.*")> This onkly seems to work in projects that...
5
by: Dave | last post by:
I need to filter an Access 2000 result set in ASP 30 using the ADO recordset.filter. I build the filter in pieces. The first clause of the filter is this... WHERE word LIKE 'S%' ... to...
0
by: savage678 | last post by:
Hi Everyone, I am new to this forum and am i dire need of some help. I am trying to use wildcard searches in infopath. I have it connected to an access database using data connection. I have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.