Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

傳回 Access 桌面資料庫中某個字串在另一個字串結尾的位置。

語法

InStrRev (stringcheck, stringmatch [, start[, compare]])

InStrRev 函數語法具有下列命名自變數:

引數

描述

stringcheck

必要。 正在搜尋字串表示式。

stringmatch

必要。 要搜尋的字串表達式。

開始

選擇性。 設定每個搜尋起始位置的數值表達式。 如果省略,會使用 –1,這表示搜尋從最後一個字元位置開始。 如果 start 包含 Null,則會發生錯誤。

compare

選擇性。 指出評估子字串時要使用的比較類型的數值。 如果省略,則會執行二進位比較。 請參閱值的 [設定] 區段。

設定

比較自變數設定為:

常數

描述

vbUseCompareOption

-1

使用 [選項比較 ] 語句的設定執行比較。

vbBinaryCompare

0

執行二進位比較。

vbTextCompare

1

執行文字比較。

vbDatabaseCompare

2

Microsoft Office Access 2007 。 根據資料庫中的資訊執行比較。

傳回值

If

InStrRev 傳回

stringcheck 為零長度

0

stringcheckNull

Null

stringmatch 為零長度

開始

stringmatchNull

Null

找不到 stringmatch

0

stringmatch 是在 stringcheck 中找到的

找到相符專案的位置

開始 > Len (stringmatch)

0

註解

請注意, InStrRev 函數的語法與 InStr 函數的語法不同。

查詢範例

Expression

結果​​

SELECT Names_InstrRev.*, InStrRev (FullName,“S”) AS 表達式1 FROM [Names_InstrRev];

從 [名稱] 資料行 “FullName” 中的值傳回字串 “S” 的位置。

SELECT Names_InstrRev.*, InStrRev (FullName,“S”,10) AS InStrTest FROM [Names_InstrRev];

從 「FullName」 資料行中的值傳回字串 「S」 的位置,從數據表的 [名稱] 的第 10 個位置開始,並顯示在 InStrTest 欄中。

字串函數及其使用方法

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×