Hey everyone!
I'm working in Access 2003 and need help with the 'order by' in a query. I have an CrewCode that includes a letter as well as numbers, and I want to sort by the numbers. The CrewCodes are for instance:
D5159
D1801
D337
D5276
When I just sort by ascending, it's all out of order. How would I do this?
THANKS SO MUCH!!!
3 2251
Hey yall,
I figured out a solution! - SELECT IIf(IsNull([CrewCode]),"",Format$(Right([CrewCode],Len([CrewCode])-1),"0000")) AS [Check]
-
FROM tblCrews
-
ORDER BY IIf(IsNull([CrewCode]),"",Format$(Right([CrewCode],Len([CrewCode])-1),"0000")) DESC;
@jmarcrum
A slightly different approach: - SELECT IIf(IsNull([CrewCode]),"",Format$(Mid$([CrewCode],2),"0000")) AS [Check]
-
FROM tblCrews
-
ORDER BY IIf(IsNull([CrewCode]),"",Format$(Mid$([CrewCode],2),"0000")) DESC;
NeoPa 32,556
Expert Mod 16PB
That's a neat solution :)
Please though, remember in future to use the [ CODE ] tags provided. As a full member now, I wouldn't expect to be needing to say this.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Sean C. |
last post by:
Helpful folks,
Most of my previous experience with DB2 was on s390 mainframe systems
and the optimizer on this platform always seemed very predictable and
consistent. Since moving to a WinNT/UDB...
|
by: Andante.in.Blue |
last post by:
I just browsed through some of my Access links when I came across the
Ten Commandments of Access
(http://www.mvps.org/access/tencommandments.htm). Some of the points
I heartily agree with (and...
|
by: Random Person |
last post by:
Does anyone know how to use VBA to relink tables between two MS Access
databases? We have two databases, one with VBA code and the other with
data tables. The tables are referenced by linked...
|
by: Paul |
last post by:
I was wondering if anyone has had an issue where using vba code to
read an excel file and import the data into an access table some
records are not imported from the excel file. It seems looking at...
|
by: Peter Frost |
last post by:
Please help
I don't know if this is possible but what I would really like to do is
to use On Error Goto to capture the code that is being executed when
an error occurs.
Any help would be much...
|
by: Yannick Turgeon |
last post by:
Hello,
We are in the process of examining our current main application. We have to
do some major changes and, in the process, are questionning/validating the
use of MS Access as front-end. The...
|
by: Mark C |
last post by:
All,
I have exhaustingly been looking through the newsgroups in search of a way
to systemically output an Access 97 report to a pdf file using the full
version of Adobe Acrobat. I want the user...
|
by: alexandre.brisebois |
last post by:
Hi, I am using access 2003, I would like to know if there is an option
to reorganize the tables in a maner that is readable, as we can do in
sql sever 2000 or 2005.
I have been given a database...
|
by: Les Desser |
last post by:
In article
<fcebdacd-2bd8-4d07-93a8-8b69d3452f3e@s50g2000hsb.googlegroups.com>, The
Frog <Mr.Frog.to.you@googlemail.comMon, 14 Apr 2008 00:45:10 writes
Not sure if I quite follow that.
1....
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |