473,325 Members | 2,872 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,325 software developers and data experts.

Find "11*" in a table, but not 11* using a wildcard

I have another newbie question for you guys... I apologize in advance for how simple it is...

I've got a string of data, included in that string is 11* as it appears, the * is not a wildcard. I'm using the function

Like "*" & "11*" & "*" to find any records that have "11*", again, the * is not a wildcard. But it's interpreting it as a wildcard, so I'm getting 1105 and 11X and so on. How can I change the formula so that it will return 11* in the middle of the string?

Thanks in advance for the help.
Oct 2 '07 #1
7 1722
ADezii
8,834 Expert 8TB
I have another newbie question for you guys... I apologize in advance for how simple it is...

I've got a string of data, included in that string is 11* as it appears, the * is not a wildcard. I'm using the function

Like "*" & "11*" & "*" to find any records that have "11*", again, the * is not a wildcard. But it's interpreting it as a wildcard, so I'm getting 1105 and 11X and so on. How can I change the formula so that it will return 11* in the middle of the string?

Thanks in advance for the help.
Avoid the confusion with treating the * Wildcard as a Literal. This will accomplish exactly what you are requesting, but only specifying an explicit Criteria instead of using the Like Operator:
Expand|Select|Wrap|Line Numbers
  1. InStr([Your String],"11*") > 0
Oct 2 '07 #2
Can I put that on the Criteria line of my query? Or do I put it somewhere else?
Oct 2 '07 #3
Select * From TABLENAME Where substr(FIELDNAME,1,3) = '11*'

Substitute TABLENAME and FIELDNAME according to what table and field your looking at.
Nov 7 '07 #4
ADezii
8,834 Expert 8TB
Select * From TABLENAME Where substr(FIELDNAME,1,3) = '11*'

Substitute TABLENAME and FIELDNAME according to what table and field your looking at.
goodmanstl7, there is no substr Function that I am aware of. Are you referring to the Transact-SQL Function SubString()?
Nov 7 '07 #5
ADezii
8,834 Expert 8TB
Can I put that on the Criteria line of my query? Or do I put it somewhere else?
Assuming you are looking for the String '11*' anywhere in the [LastName] Field of tblEmployees:
  1. You can place it in the Criteria Row of the Query Grid, in this demo in the [LastName] Field:
    Expand|Select|Wrap|Line Numbers
    1. InStr([LastName],"11*")>"0"
  2. You can place it in an SQL Statement directly and return all Records meeting the Criteria:
    Expand|Select|Wrap|Line Numbers
    1. SELECT tblEmployeePFD.LastName, *
    2. FROM tblEmployeePFD
    3. WHERE ((InStr([LastName],"11*")>"0"));
Nov 8 '07 #6
missinglinq
3,532 Expert 2GB
Just out of curiosity, ADezii, could you have used

Expand|Select|Wrap|Line Numbers
  1. InStr([LastName],"11" & Chr(42))>"0"
as well?

Linq ;0)>
Nov 8 '07 #7
ADezii
8,834 Expert 8TB
Just out of curiosity, ADezii, could you have used

Expand|Select|Wrap|Line Numbers
  1. InStr([LastName],"11" & Chr(42))>"0"
as well?

Linq ;0)>
Sorry Linq, don't know how I missed this one but InStr([LastName],"11" & Chr(42))>"0" will work equally as well.
Nov 9 '07 #8

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

Similar topics

81
by: Matt | last post by:
I have 2 questions: 1. strlen returns an unsigned (size_t) quantity. Why is an unsigned value more approprate than a signed value? Why is unsighned value less appropriate? 2. Would there...
4
by: Friday | last post by:
Being an Old L.A.M.P guy, I beg you to please excuse my ignorance of dot.net (and all things Windows, for that matter). As part of an experiment (to learn enough ASP/VB.net to port a series of ...
13
by: N. Graves | last post by:
Thanks for taking time to read my questions. I'm looking for a way in Access that I could run a query that would return table schema information. Specifically I need to get the column name,...
4
by: jason.awlt | last post by:
Greetings, I recently being bugged by the following error on my DB2. SQL0902C SQLSTATE = 58005 Reason Code = 14 This error comes out everytime i tried to insert some record to a table...
10
by: NH | last post by:
I have a girdview with paging enabled. How can I add a message in the footer to say "Viewing records 1-15 of 45" etc Thanks
6
by: Jurgen Haan | last post by:
Hi hi, I'm trying to perform a redirected restore, but I get a nice error returned. Does anyone have an idea of what the -5130 errorcode means? db2inst@ELMO:~> db2 restore db efproddb into...
9
by: Tristán White | last post by:
Hi I am very new to PHP - actually, this is my second day at it, as I've only recently started a new job last week. We're a charity. I have a "No input file selected" problem. A Google search...
4
by: Randy | last post by:
Hi, I have a table which contains a unique value in a column called "Idx", which is a smallint data type. I need to find the maximum value in this column, which I have been attempting to do with...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.