MS Access InstrRev()ฟังก์ชัน
ตัวอย่าง
ค้นหา "t" ในสตริง "Customer" (เริ่มจากจุดสิ้นสุดของสตริง) และส่งคืนตำแหน่ง:
SELECT InstrRev("Customer", "t") AS
MatchPosition;
ความหมายและการใช้งาน
ฟังก์ชัน InstrRev() รับตำแหน่งการเกิดขึ้นครั้งแรกของสตริงในอีกรายการหนึ่ง จากจุดสิ้นสุดของสตริง
ฟังก์ชันนี้ทำการค้นหาแบบคำนึงถึงขนาดตัวพิมพ์
ไวยากรณ์
InstrRev(string1, string2,
start,
compare)
ค่าพารามิเตอร์
Parameter | Description |
---|---|
string1 | Required. The string to be searched |
string2 | Required. The string to search for |
start | Optional. The start position for the search. Position -1 is default (which means that it starts with the last character position) |
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
- ถ้า string2 มีความยาวเป็นศูนย์ ฟังก์ชันนี้จะคืนค่าใน start parameter
- ถ้า string1 มีความยาวเป็นศูนย์ ฟังก์ชันนี้จะคืนค่า 0
- ถ้า string1 เป็นค่าว่าง ฟังก์ชันนี้จะคืนค่า null
- ถ้า start เป็น > มากกว่าความยาวของ string2 ฟังก์ชันนี้จะคืนค่า 0
รายละเอียดทางเทคนิค
ทำงานใน: | จากการเข้าถึง 2000 |
---|