MS Access InStr()- functie
Voorbeeld
Zoek naar "t" in de tekenreeks "Klant" en retourneer positie:
SELECT InStr("Customer", "t") AS MatchPosition;
Definitie en gebruik
De functie InStr() haalt de positie op van het eerste voorkomen van een string in een andere.
Deze functie voert een hoofdletterongevoelige zoekopdracht uit.
Syntaxis
InStr(start, string1, string2,
compare)
Parameterwaarden
Parameter | Description |
---|---|
start | Optional. The start position for the search. Position 1 is default |
string1 | Required. The string to be searched |
string2 | Required. The string to search for |
compare | Optional. The type of string comparison. Possible values: -1: Use the setting of Option Compare 0: Binary comparison 1: Textual comparison 2: Comparison based on info in your database |
Retourwaarden
- Als string2 niet wordt gevonden binnen string1, retourneert deze functie 0
- Als string1 de lengte nul heeft, retourneert deze functie 0
- Als string1 null is, retourneert deze functie null
- Als string2 de lengte nul heeft, retourneert deze functie de waarde in de startparameter
- Als start > is dan de lengte van string2, retourneert deze functie 0
Technische details
Werkt in: | Van Access 2000 |
---|