Sort?

  • Thread starter Thread starter Don
  • Start date Start date
D

Don

I have a field with names such as d* and 1d* and 2d* etc. By default, Access
wants to sort starting with 1d* then 2d* and ending with d*. How can I have
it sort starting with d* and then 1d* and then 2d*, etc. What expression
would I use. Thank you for your time, Don
 
Put the following exoression in a blank field in your query:
SortOrder:Val([NameOfThe Field])
Sort on this field.
 
Don said:
I have a field with names such as d* and 1d* and 2d* etc. By default, Access
wants to sort starting with 1d* then 2d* and ending with d*. How can I have
it sort starting with d* and then 1d* and then 2d*, etc. What expression
would I use.

ORDER BY Val(field),
IIf(CStr(Val(field))=Left(field, Len(Val(field))),
Mid(field, Len(nn)+1), field)
 
Back
Top