I would like to create a query that will work in steps, if this is at all possible. I'm using some internal company numbers, however to illustrate what I'm looking for I'll use a telephone number.
Assuming that the telephone number field is XXX-XXX-XXXX (10 digits).
I would like a query that would first look for an exact match (XXX-XXX-XXXX). If that is found, return the value queried on.
If that is not found, next try to match on the first 6 digits (XXX-XXX)
If that is not found, finally match on only the first 3 digits (XXX)
Is there a query that would work like this?
Assuming that the telephone number field is XXX-XXX-XXXX (10 digits).
I would like a query that would first look for an exact match (XXX-XXX-XXXX). If that is found, return the value queried on.
If that is not found, next try to match on the first 6 digits (XXX-XXX)
If that is not found, finally match on only the first 3 digits (XXX)
Is there a query that would work like this?