Sort field containing text and numbers

D

Deanna

I need to know how to sort a field that contains numbers
and records like this:

A.1.1
A.1.2
A.1.3...
A.1.10
A.1.11

It currently sorts like this:
A.1.1
A.1.10
A.1.11
A.1.2
A.1.3

The field is manually inputed and the beginning letter and
middle numbers also change. Any help is appreciated!
Deanna
 
J

John Vinson

I need to know how to sort a field that contains numbers
and records like this:

A.1.1
A.1.2
A.1.3...
A.1.10
A.1.11

It currently sorts like this:
A.1.1
A.1.10
A.1.11
A.1.2
A.1.3

The field is manually inputed and the beginning letter and
middle numbers also change. Any help is appreciated!
Deanna

With of course an arbitrary number of dots, I presume? i.e. you might
also have A.1.3.1.2.5?

This is VERY difficult to sort correctly. You'll need some VBA code
using the Split() function to create an array and return a sortkey. I
don't think there's any way to do it directly in a SQL query (though
I'd be interested to see one).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top