Re: Sorting Access text fields?

by "Darrell King" <darrell(at)webctr.com>

 Date:  Wed, 10 Oct 2001 15:13:31 -0400
 To:  "Mike Taylor" <lonewolf(at)one.net>,
<hwg-techniques(at)hwg.org>
 References:  one
  todo: View Thread, Original
did you try SQL's "ORDER BY" clause?

SELECT [FIELDNAME] 
 FROM [TABLENAME] 
  ORDER BY [FIELDNAME]

...?


----- Original Message ----- 
From: "Mike Taylor" <lonewolf(at)one.net>
To: <hwg-techniques(at)hwg.org>
Sent: Wednesday, October 10, 2001 1:47 PM
Subject: Sorting Access text fields?


Suppose I have an Access database table with a text field that has the
following data: (B1, B2, B5, B8, B11, B70, B170).  I want them sorted
exactly in that order.  However, because this is a text field, it doesn't
sort them that way at all.  

Is there a way to sort these properly programmatically without changing
the nature of the Access table field itself? Or perhaps some functions in
SQL that will do this?  The only thing I can come up with is writing
something in VBScript that creates an array, stripping out the letter "B",
then building a function to sort these numerically and then re-adding the
"B" prefix.  Yikes. 

Thanks.

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA