[AccessD] Sort mixed alpha numeric data

John Bartow john at winhaven.net
Tue Jun 17 21:49:13 CDT 2003


Hi Gustav,
Thanks for the suggestion. I'll give it a try in the morning.

John

> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Gustav Brock
> Sent: Tuesday, June 17, 2003 2:13 AM
> To: accessd at databaseadvisors.com
> Subject: Re: [AccessD] Sort mixed alpha numeric data
> 
> 
> Hi John
> 
> > I have a test field where the data is generally 1,2,3,4,5 but can also
> > include 1a, 1b, 1c.
> 
> > Would any one happen to have ideas for a way (or code for a 
> function that
> > will) sort mixed data numerically first and then alphabetically?
> 
> So how are you sorting them now? The data must be strings and sorted
> as such. Or do you have data with more than one digit, like 15c?
> 
> If so, sort on the numeric value then the ascii value:
> 
> <SQL>
> 
>   SELECT
>     *
>   FROM
>     tblYourTable
>   ORDER BY
>     Val(StringID),
>     StringID;
> 
> </SQL>
> 
> /gustav
> 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> 



More information about the AccessD mailing list