Solved How to select all entries that begin with a given value? (1 Viewer)

mamradzelvy

Member
Local time
Tomorrow, 00:48
Joined
Apr 14, 2020
Messages
96
Hi,
I'm using a simple query to export records based on client names.
And the WHERE part of my query looks like this WHERE (((Tabule1.TabKlient)=[Formuláře]![formTabuleMini]![txtKlient])) OR ((([Formuláře]![formTabuleMini]![txtKlient]) Is Null));
(This works well, "formuláře" is a valid syntax in my language's access version, don't worry about it)
What im worried about is how to make it so that the rest of the client name can be whatever, for instance i have clients such as "Pepsi; Pepsi-CityName; Pepsi-AnotherCity" and when i put in just pepsi, i would like it to select everything that begins with pepsi.
How would i write the proper syntax for that?
 

bob fitz

AWF VIP
Local time
Today, 23:48
Joined
May 23, 2011
Messages
3,741
Try:
WHERE (((Tabule1.TabKlient)=Like [Formuláře]![formTabuleMini]![txtKlient] & "*")) OR ((([Formuláře]![formTabuleMini]![txtKlient]) Is Null));
 

arnelgp

error reading drive A:
Local time
Tomorrow, 06:48
Joined
May 7, 2009
Messages
9,273
Code:
WHERE ((InStr([TabKlient],Nz([Formuláře]![formTabuleMini]![txtKlient],[TabKlient]))>0));
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom