How to sort graduation dates in the form of "SS77", "FS09", "FS11", etc.

Spartanhockey

New Member
Joined
May 6, 2011
Messages
1
I have a list of graduation dates that are scattered. For example:

SS67
SS78
US99
FS01
FS11
SS77
US69

I want them to sort by the numeric portion first. So I want it to look like this

SS67
US69
SS77
SS78
US99
FS01
FS11

I have the data in access. Is there anyway I can create a query that will let me find all dates that are: US67< X < FS01
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
You need a subquery which extracts the numeric part of the year from the four-character version of the date (the bit inside the parentheses), then you pass the data with its newely-created two-digit date to a query which sorts it. Try this:-
Code:
SELECT [COLOR=red][B]graddate[/B][/COLOR] FROM 
    (SELECT [COLOR=red][B]graddate[/B][/COLOR], MID([COLOR=red][B]graddate[/B][/COLOR],3,2) AS gradyear FROM [COLOR=red][B]tblGradDates[/B][/COLOR]) 
ORDER BY gradyear;
Change the bits in red to match your table and field names.

(This should be in the Microsoft Access forum really.)
 
Upvote 0
Minor correction - I left the year selection criteria out:-
Code:
SELECT [COLOR=red][B]graddate[/B][/COLOR] FROM 
    (SELECT [COLOR=red][B]graddate[/B][/COLOR], MID([COLOR=red][B]graddate[/B][/COLOR],3,2) AS gradyear FROM [COLOR=red][B]tblGradDates[/B][/COLOR])
WHERE gradyear > 67 OR gradyear < 01
ORDER BY gradyear;
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,908
Members
452,949
Latest member
beartooth91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top