Searching for

smilman

New member
Local time
Today, 16:57
Joined
Jan 17, 2019
Messages
5
Our company is using an asterisk - * in the description to note an item's status. In a query, I want to select any item that has and asterisk in the description. The use of the same wild card in MS Access has presented some difficulty. I have been looking and trying solutions manually, but would appreciate help for this issue. The solution in Excel is =IFERROR(IF(FIND(CHAR(42),E5)>0,"Discontinued"),"").

Thank-you
 
Probably isn't very efficient but one way:

WHERE InStr(1,FieldName,"*")>0
 
If the entire field contents are just *, then use [*]. Access will add Like automatically in a query to give Like "[*]"
If it's just somewhere in the text string then use e.g. Like "*[*]*"

Using leading and trailing wildcards is also inefficient as it forces Access to search each record in full.
 
Another way is:


Code:
SELECT...FROM...WHERE FieldName Like "*
[*]*"
 
Thank-you both for your update.
Both worked for my issue - returning the exact same number of records.
InStr(1,[Description],"*")>"0"
Like "*[*]*"
 
Use their method. Mine is probably less efficient as it applies the function to every record in the table.
 

Users who are viewing this thread

Back
Top Bottom