473,408 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

sorting mixed data types in field

I have a fairly simple database of registered voters in a county. The
Field for a voters Apartment; RES_APT contains about 85% numeric
("110", "325", "1144", etc etc) and the other 15% is either text and
mixed such as "Floor 2", "A-2", B, "B-1" etc etc etc. (About 40% of
the records are null for this field BTW)
Since I cannot have a numeric field here I have a dilema. As you know
the numbers will sort as text. My problem is obvious, how can I get
the numbers in this text field to sort as numeric without adding
leading zeros. Most of the apt numbers pertain to hi rise buildings
and if I could at least get those numbers to sort as numeric I would
be satisfied since the others are only a small percentage of the
total. Please help if you can. I am not a programmer but can use
Access pretty well. It is important that I sort thes numbers in this
text field the right way!

Mike C
Nov 12 '05 #1
2 2308
Mike C wrote:
Since I cannot have a numeric field here I have a dilema. As you know
the numbers will sort as text. My problem is obvious, how can I get
the numbers in this text field to sort as numeric without adding
leading zeros.


Append leading spaces?
--
Bas Cost Budde
http://www.heuveltop.org/BasCB
but the domain is nl

Nov 12 '05 #2
On 14 Feb 2004 13:51:16 -0800, mi************@earthlink.net (Mike C) wrote:
I have a fairly simple database of registered voters in a county. The
Field for a voters Apartment; RES_APT contains about 85% numeric
("110", "325", "1144", etc etc) and the other 15% is either text and
mixed such as "Floor 2", "A-2", B, "B-1" etc etc etc. (About 40% of
the records are null for this field BTW)
Since I cannot have a numeric field here I have a dilema. As you know
the numbers will sort as text. My problem is obvious, how can I get
the numbers in this text field to sort as numeric without adding
leading zeros. Most of the apt numbers pertain to hi rise buildings
and if I could at least get those numbers to sort as numeric I would
be satisfied since the others are only a small percentage of the
total. Please help if you can. I am not a programmer but can use
Access pretty well. It is important that I sort thes numbers in this
text field the right way!

Mike C


Let's say, you're field is called Foo...

.... ORDER BY IIf(IsNumeric(Foo), CDbl(Foo), CDbl(0)) Asc, Foo Asc
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: pmud | last post by:
Hi, I am using teh following code for sorting the data grid but it doesnt work. I have set the auto generate columns to false. & set the sort expression for each field as the anme of that...
7
by: Federico G. Babelis | last post by:
Hi All: I have this line of code, but the syntax check in VB.NET 2003 and also in VB.NET 2005 Beta 2 shows as unknown: Dim local4 As Byte Fixed(local4 = AddressOf dest(offset)) ...
8
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
2
by: bearophileHUGS | last post by:
Notes: - This email is about Mark Dufour's Shed Skin (SS) (http://shed-skin.blogspot.com), but the errors/ingenuousness it contains are mine. My experience with C++ is limited still. - The...
4
by: Lonewolf | last post by:
hi, I'm still in the process of transiting from MFC/VC6 to vs2005, and a lot of things are very alien to me. So hope you could bear with me if my question sounds stupid. Basically I have native...
11
by: garyhoran | last post by:
Hi Guys, I have a collection that contains various attributes (stuff like strings, DateTime and Timespan) . I would like to access the collection in various orders at different points in the...
1
KevinADC
by: KevinADC | last post by:
Introduction In part one we discussed the default sort function. In part two we will discuss more advanced techniques you can use to sort data. Some of the techniques might introduce unfamiliar...
3
KevinADC
by: KevinADC | last post by:
If you are entirely unfamiliar with using Perl to sort data, read the "Sorting Data with Perl - Part One and Two" articles before reading this article. Beginning Perl coders may find this article...
6
by: =?Utf-8?B?RGFu?= | last post by:
I am reposting a question from about 3 weeks ago ("sorting capability"). I have an aspx page in which I get the data from a database dynamically, through C# code, by creating a dynamic table...
0
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
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...
0
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...
0
marktang
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,...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.