PC Review


Reply
Thread Tools Rate Thread

Help With Sorting Alphanumeric Data

 
 
=?Utf-8?B?SmF5IE1haXRyaQ==?=
Guest
Posts: n/a
 
      20th Aug 2006
Hi,

I am an academic historical researcher and have recently built a database
for research I am currently doing on Australian World War 1 soldiers who
fought on the Gallipoli Peninsula (Turkey).

One of the data fields in my database is for tracking the assigned serial
numbers of these men. I choose to use a text data type because serial
numbers because Officers were not assigned serial numbers (I leave the serial
number field blank for their records) and Enlisted men were either assigned a
number or a numeric-alpha number for their serial number.

Enlisted men’s numbers range from 1 to 5 digits in length. If they were
assigned a numeric-alpha serial number, their number is followed by just 1
letter.

I would like to sort my data by listing Officers first (serial numbers are
blank) and then Enlisted men in ascending order:

(blank) Officer
(blank) Officer
1 Enlisted
2 Enlisted
2A Enlisted
6 Enlisted
6A Enlisted
6B Enlisted
and so forth

I’ve searched various discussion groups via Google and tried a few things
which either have not worked or not worked well.

I’m a complete novice—hence ignorant with using query expression and with
writing code for modules—with building databases and with Access (I’m using
2003).

I surely will appreciate any help anyone can provide!

Thank you,
Jay

 
Reply With Quote
 
 
 
 
Ken Snell \(MVP\)
Guest
Posts: n/a
 
      20th Aug 2006
Something like this:

SELECT SerialNumber, OfficerRank
FROM TableName
ORDER BY Val(Nz([SerialNumber],0) ASC,
SerialNumber ASC;

--

Ken Snell
<MS ACCESS MVP>




"Jay Maitri" <(E-Mail Removed)> wrote in message
news:4C0144DC-203A-4E22-A250-(E-Mail Removed)...
> Hi,
>
> I am an academic historical researcher and have recently built a database
> for research I am currently doing on Australian World War 1 soldiers who
> fought on the Gallipoli Peninsula (Turkey).
>
> One of the data fields in my database is for tracking the assigned serial
> numbers of these men. I choose to use a text data type because serial
> numbers because Officers were not assigned serial numbers (I leave the
> serial
> number field blank for their records) and Enlisted men were either
> assigned a
> number or a numeric-alpha number for their serial number.
>
> Enlisted men's numbers range from 1 to 5 digits in length. If they were
> assigned a numeric-alpha serial number, their number is followed by just 1
> letter.
>
> I would like to sort my data by listing Officers first (serial numbers are
> blank) and then Enlisted men in ascending order:
>
> (blank) Officer
> (blank) Officer
> 1 Enlisted
> 2 Enlisted
> 2A Enlisted
> 6 Enlisted
> 6A Enlisted
> 6B Enlisted
> and so forth
>
> I've searched various discussion groups via Google and tried a few things
> which either have not worked or not worked well.
>
> I'm a complete novice-hence ignorant with using query expression and with
> writing code for modules-with building databases and with Access (I'm
> using
> 2003).
>
> I surely will appreciate any help anyone can provide!
>
> Thank you,
> Jay
>



 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmF5IE1haXRyaQ==?=
Guest
Posts: n/a
 
      21st Aug 2006
I'll give it a go.

Thank you Ken!
Jay


"Ken Snell (MVP)" wrote:

> Something like this:
>
> SELECT SerialNumber, OfficerRank
> FROM TableName
> ORDER BY Val(Nz([SerialNumber],0) ASC,
> SerialNumber ASC;
>
> --
>
> Ken Snell
> <MS ACCESS MVP>
>
>
>
>
> "Jay Maitri" <(E-Mail Removed)> wrote in message
> news:4C0144DC-203A-4E22-A250-(E-Mail Removed)...
> > Hi,
> >
> > I am an academic historical researcher and have recently built a database
> > for research I am currently doing on Australian World War 1 soldiers who
> > fought on the Gallipoli Peninsula (Turkey).
> >
> > One of the data fields in my database is for tracking the assigned serial
> > numbers of these men. I choose to use a text data type because serial
> > numbers because Officers were not assigned serial numbers (I leave the
> > serial
> > number field blank for their records) and Enlisted men were either
> > assigned a
> > number or a numeric-alpha number for their serial number.
> >
> > Enlisted men's numbers range from 1 to 5 digits in length. If they were
> > assigned a numeric-alpha serial number, their number is followed by just 1
> > letter.
> >
> > I would like to sort my data by listing Officers first (serial numbers are
> > blank) and then Enlisted men in ascending order:
> >
> > (blank) Officer
> > (blank) Officer
> > 1 Enlisted
> > 2 Enlisted
> > 2A Enlisted
> > 6 Enlisted
> > 6A Enlisted
> > 6B Enlisted
> > and so forth
> >
> > I've searched various discussion groups via Google and tried a few things
> > which either have not worked or not worked well.
> >
> > I'm a complete novice-hence ignorant with using query expression and with
> > writing code for modules-with building databases and with Access (I'm
> > using
> > 2003).
> >
> > I surely will appreciate any help anyone can provide!
> >
> > Thank you,
> > Jay
> >

>
>
>

 
Reply With Quote
 
=?Utf-8?B?SmF5IE1haXRyaQ==?=
Guest
Posts: n/a
 
      21st Aug 2006
Ken, I got it to work with the following in the last line of the SQL statement:

ORDER BY Val(Nz([SerialNbr],0)), SerialNbr;

I appreciate your help!
Jay

"Jay Maitri" wrote:

> I'll give it a go.
>
> Thank you Ken!
> Jay
>
>
> "Ken Snell (MVP)" wrote:
>
> > Something like this:
> >
> > SELECT SerialNumber, OfficerRank
> > FROM TableName
> > ORDER BY Val(Nz([SerialNumber],0) ASC,
> > SerialNumber ASC;
> >
> > --
> >
> > Ken Snell
> > <MS ACCESS MVP>
> >
> >
> >
> >
> > "Jay Maitri" <(E-Mail Removed)> wrote in message
> > news:4C0144DC-203A-4E22-A250-(E-Mail Removed)...
> > > Hi,
> > >
> > > I am an academic historical researcher and have recently built a database
> > > for research I am currently doing on Australian World War 1 soldiers who
> > > fought on the Gallipoli Peninsula (Turkey).
> > >
> > > One of the data fields in my database is for tracking the assigned serial
> > > numbers of these men. I choose to use a text data type because serial
> > > numbers because Officers were not assigned serial numbers (I leave the
> > > serial
> > > number field blank for their records) and Enlisted men were either
> > > assigned a
> > > number or a numeric-alpha number for their serial number.
> > >
> > > Enlisted men's numbers range from 1 to 5 digits in length. If they were
> > > assigned a numeric-alpha serial number, their number is followed by just 1
> > > letter.
> > >
> > > I would like to sort my data by listing Officers first (serial numbers are
> > > blank) and then Enlisted men in ascending order:
> > >
> > > (blank) Officer
> > > (blank) Officer
> > > 1 Enlisted
> > > 2 Enlisted
> > > 2A Enlisted
> > > 6 Enlisted
> > > 6A Enlisted
> > > 6B Enlisted
> > > and so forth
> > >
> > > I've searched various discussion groups via Google and tried a few things
> > > which either have not worked or not worked well.
> > >
> > > I'm a complete novice-hence ignorant with using query expression and with
> > > writing code for modules-with building databases and with Access (I'm
> > > using
> > > 2003).
> > >
> > > I surely will appreciate any help anyone can provide!
> > >
> > > Thank you,
> > > Jay
> > >

> >
> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting Alphanumeric data in Excel 2003 =?Utf-8?B?YmlsbGQ=?= Microsoft Excel Setup 8 2nd Aug 2012 07:45 PM
Sorting alphanumeric data at 2nd, 3rd or 4th character position kykles Microsoft Excel Misc 5 3rd Jun 2009 12:18 AM
Sorting mixed alphanumeric data coxrail Microsoft Access VBA Modules 6 14th Sep 2008 02:10 PM
Sorting by complex alphanumeric data =?Utf-8?B?U2FuZGll?= Microsoft Access Reports 8 6th Feb 2007 07:29 AM
SORTING ALPHANUMERIC DATA =?Utf-8?B?enl1cw==?= Microsoft Access 1 16th Dec 2005 05:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:35 PM.