Sorting in Access 2013/SQL 2012

I've been given a database to modify.  It's an Access front with a SQL back-end.  
They want to sort by the case number with the newest one listed first; no big deal, except that the case number is the two digit year followed by another number..."15-017" (basically, the 17th case in 2015).  Basically I need to sort by the first number, then the second number.  It's stored as one record (nvarchar10) in SQL.  Unfortunately, there is data from the late 1900s so there are some cases that start with 99-, 98-, 97-, etc.
The sorting only needs to be done on one form so I would like to do this within the Access front end and not have to change anything in SQL.
I'm not overly experienced in Access so would like to keep the resolution as simple as possible.

Any ideas?

Thanks,
~Rick
dcgimoAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Unless you have another Date field you can use, you'll probably need to split up that concated value into the "atomic" parts. If the format is always "99-000", then you could use this in an Access query:

SELECT LEFT(YourField, 2) AS SeqYear, RIGHT(YourField, 3) AS SeqNum, OtherCol1, OtherCol2, OtherCol3, etc FROM YourTable

From there you could "sort" by SeqYear and SeqNum. You might find you need to add the full year:

SELECT IIF(Left(YOurField, 2) > 80, '19' + Left(YourField, 2), '20' + Left(YourField,2) AS SeqYear, etc etc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dcgimoAuthor Commented:
Is there a way to split it in the front-end without modifying the table in SQL?

Thanks,
~Rick
0
Jeffrey CoachmanMIS LiasonCommented:
No Points wanted...

What Scott posted would be done in a query, (in the front end)...then that query would be used instead of a "table"
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
As Jeff indicates, you can do this in the FrontEnd with a Query, or you can add a View to the backend (no table mods needed) and perform the split there. If you use a View, you'll have to "link" the view to your FE, of course. In most cases, unless there are some heavy duty lifting to be done, you're better off doing this in Access.
0
dcgimoAuthor Commented:
Working with a coworker on this that is more proficient in Access/SQL, she was able to get what we need with a view and your statements above, Scott.  All we need now is to figure a way to enter data via the view.  

Thanks,
~Rick
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Generally speaking, if the tables on which your View is based allow for mods/adds/deletes, then you should be able to edit data through the view.

This MSDN article may shed some light:

https://msdn.microsoft.com/en-us/library/ms180800.aspx
0
dcgimoAuthor Commented:
Thanks for the assistance.  It's working great now!
~Rick
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.