473,411 Members | 1,937 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,411 software developers and data experts.

How to sort a data set of addresses?

9
I am tryn to make a datasheet to show the address. I have the fields: house no, street, town, city.

When I try to sort, the house numbers are not in order? How can i sort them?
Oct 21 '10 #1
11 1861
nico5038
3,080 Expert 2GB
Your problem is caused by the fact that your house number is obviously a text field and no real number.
As a house number can have a suffix, you'll need to "split" the field in two part, a number defined as number and the (optional) suffix. To sort both fields need to be used.

Nico
Oct 21 '10 #2
brin
9
Thank you for the response. But how do i split the field? im new to access. thanks in advance.
Oct 22 '10 #3
NeoPa
32,556 Expert Mod 16PB
Brin, your question is very short of information.

Get that fixed then we won't be guessing so much what you're talking about.
Oct 22 '10 #4
brin
9
sorry abt tht. Bascialy i got four fields. house no/name, street, city, post code. when i view the data in data sheet, address are not in assending order. 1 windor road,3 windor road,10 windsor road, 4 windsor road etc... they are not n order. such as 1 windsor, 2 windsor, 3 windsor so on...how to sort them in orer? thanks in advance experts...
Oct 22 '10 #5
nico5038
3,080 Expert 2GB
First check or you have addresses with a (character) suffix like: "10 A" or "10-02"
Next add a new textfield "HousenumberSuffix" and "move" the "A" and "-02" to there.
Now change the Housenumber field into a number type and your sort will work correctly when sorting first the house number and than the suffix.

Nico
Oct 22 '10 #6
NeoPa
32,556 Expert Mod 16PB
We're still in a similar place really. Sorting something in order relies on knowing which order to sort them in. I doubt simply sorting by House Number would be much use to you. What order of the four fields would you need?

As a taster, the general answer is to set the Sort: row in your query for the fields you require, and ensure they are displayed in the field order required.
Oct 22 '10 #7
brin
9
My database includes the two fields

"House Number" & "Street"......currently I have it in ascending order by "Street", but i want to sort them by house number and street. Eg: 1 windor road, 2 windsor road, 3 windsor road. At the moment it shows like: 2 windsor road, 1 windsor road, 3 windsor road etc... Please help me.

many thanks in advance

Brin
Oct 28 '10 #8
nico5038
3,080 Expert 2GB
Just place first housenumber and than street in your query editor. Next set for both the sort to ascending.

Nico
Oct 28 '10 #9
brin
9
i did tht nico. it wsnt working untill i place the street first and house secound. it works ok now. i did follow this link {SNIP - Illegal link removed}
Thanks for all of you.
Oct 28 '10 #10
NeoPa
32,556 Expert Mod 16PB
If I must pull teeth :-

Where would '2 Bromley Road' appear in your list? Or, to repeat part of my earlier question, which order should the separate fields be sorted in? Number then street (pretty daft for most cases)? Or street then number?

PS. Never mind. Now that your latest post has appeared it's clear what the order should have been. Had you answered the question when asked I'm confident the instructions would have accurately supported your requirement.
Oct 28 '10 #11
brin
9
once again thanks so much guys... u guys r real experts...
Oct 28 '10 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Paul Fairless | last post by:
Customers table - contains Columns: CustID, Surname, Forename, TtlID Titles table - contains Columns: TtlID, Title TtlID is a Foreign Key in the Customers table. I have a Form frmCustomers...
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)) ...
22
by: mike | last post by:
If I had a date in the format "01-Jan-05" it does not sort properly with my sort routine: function compareDate(a,b) { var date_a = new Date(a); var date_b = new Date(b); if (date_a < date_b)...
0
by: noureensyed | last post by:
Hi there, Any ideas on how to sort an xml of the type below. I want to output the exact same xml as well just sorted. However in my case I want to select a particular column tag below, say...
3
by: Neil Hindry | last post by:
I wonder if you can help me. I have setup an address-book database in Access XP. I have the first name & surname as separate fields. As I wanted to sort my database by surname and then by first...
3
by: marc | last post by:
Hi, I have a collection of objects and i would like to add a flexibel sorting functionality I am looking for a colliection that gives my the following functionality a - have enumaration to...
5
by: Tmuld | last post by:
(using vb.net) Finally got paging working...not sorting taunts me... For sorting on a datagrid - do you HAVE to use a dataview? I used the msdn example and now get his error: DataTable...
4
by: Robert Fitzpatrick | last post by:
Thanks to some help here on the list, I've been able to get addresses sorting pretty well, but now I have a issue with same addresses on different streets not grouping the streets. This is what I'm...
4
by: FBM | last post by:
Hi, I am working on a program that simulates one of the elements of ATM. The simulation stores events which occurs every some milliseconds for a certain amount of time. Every time that an event...
3
by: gagonm | last post by:
Hi All I have an urgent issue where I m transforming an xml structure into html page using xslt . since data is more , I need to do Pagination .Also there is an option to do sorting of ...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.