MS Access InStr()関数
例
文字列「Customer」で「t」を検索し、位置を返します。
SELECT InStr("Customer", "t") AS MatchPosition;
定義と使用法
InStr()関数は、別の文字列で最初に出現する文字列の位置を取得します。
この関数は、大文字と小文字を区別しない検索を実行します。
構文
InStr(start, string1, string2,
compare)
パラメータ値
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 |
戻り値
- string2がstring1内に見つからない場合、この関数は0を返します
- string1の長さがゼロの場合、この関数は0を返します
- string1がnullの場合、この関数はnullを返します
- string2の長さがゼロの場合、この関数は開始パラメーターの値を返します
- startがstring2の長さより大きい場合、この関数は0を返します
技術的な詳細
で動作します: | Access2000から |
---|