Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the Instr() function 1

Status
Not open for further replies.

dgillz

Instructor
Mar 2, 2001
10,051
US
I am looking for a way to test for the existence of a substring within a string in a MS Access query. In Crystal I could do this as follows:

Instr(Sting,substring)>0

However I am having troubling getting th same info out of Access. Any ideas would be appreciated.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
askdon@srhconsulting.com
 
Looks exactly the same in Access

Instr ( "ABCD", "C" ) produces 3
 
Hi,

The method is very similar but the first parameter for INSTR in Access in start, i.e

Instr(1,Sting,substring)>0

would produce the same results.

Andrew
 
afryer
True enough but the first parameter is optional. If it if of numeric type then it is assumed to be the start position. If it is a string then it is assumed to be the string to search. Either construct will work.
 
Many thanks, people like you are why I come to tek-tips.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
askdon@srhconsulting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top