The below takes a field (called name) with first name and last name and sorts it by alpabetical order by last name.
name Field values
John Smith
Richard Dawson
Carl Anderson
Result of query:
Carl Anderson
Richard Dawson
John Smith
Please explain what is going on in this sql?
Does InStr cut up the field into arrays?
firstname is 0?
Space is 1?
Lastname is 2?
What is Chr(32) + 1?
What is the mid and function doing??
name Field values
John Smith
Richard Dawson
Carl Anderson
Result of query:
Carl Anderson
Richard Dawson
John Smith
Code:
SELECT name
FROM TableOne
ORDER BY Mid(name, InStr(1, name, Chr(32)) + 1)
Please explain what is going on in this sql?
Does InStr cut up the field into arrays?
firstname is 0?
Space is 1?
Lastname is 2?
What is Chr(32) + 1?
What is the mid and function doing??