MS Access InstrRev() 函式
示例
在字串“Customer”中搜索“t”(從字串末尾開始)並返回位置
SELECT InstrRev("Customer", "t") AS MatchPosition;
定義和用法
InstrRev() 函式從字串末尾獲取一個字串在另一個字串中第一次出現的位置。
此函式執行不區分大小寫的搜尋。
語法
InstrRev(string1, string2, start, compare)
引數值
引數 | 描述 |
---|---|
string1 | 必需。要搜尋的字串 |
string2 | 必需。要搜尋的字串 |
start | 可選。搜尋的起始位置。預設值為 -1(表示從最後一個字元位置開始) |
比較 | 可選。字串比較的型別。 可能的值 -1:使用 Option Compare 的設定 0:二進位制比較 1:文字比較 2:基於資料庫資訊的比較 |
返回值
- 如果在 string1 中未找到 string2,則此函式返回 0
- 如果 string2 為空,則此函式返回 start 引數中的值
- 如果 string1 為空,則此函式返回 0
- 如果 string1 為 null,則此函式返回 null
- 如果 start 大於 string2 的長度,則此函式返回 0
技術詳情
支援版本 | 從 Access 2000 開始 |
---|