ฟังก์ชันMS Access Mid()
ตัวอย่าง
แยกอักขระออกจากสตริง โดยเริ่มต้นที่ตำแหน่ง 3:
SELECT Mid("SQL Tutorial", 3) AS ExtractString;
ความหมายและการใช้งาน
ฟังก์ชัน Mid() จะแยกอักขระบางตัวออกจากสตริง (เริ่มต้นที่ตำแหน่งใดก็ได้)
ไวยากรณ์
Mid(string, start, length)
ค่าพารามิเตอร์
Parameter | Description |
---|---|
string | Required. The string to extract from |
start | Required. The start position |
length | Optional. The number of characters to extract. If omitted, this function returns all characters from the start position |
รายละเอียดทางเทคนิค
ทำงานใน: | จากการเข้าถึง 2000 |
---|
ตัวอย่างเพิ่มเติม
ตัวอย่าง
แยกอักขระออกจากข้อความในคอลัมน์ (เริ่มต้นที่ตำแหน่ง 4 และแยกอักขระ 6 ตัว):
SELECT Mid(CustomerName, 4, 6) AS ExtractString
FROM Customers;