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

Query Problem

This might be the wrong group (but it is my favorite)

I need to sort a list data from a text field into numerical order.

The data needs looks like this: -

a1
1
1a
2
3
4
29
29A
29X
25X
X25

However, the data could be put into the database in any order with additions
by a user so I cannot rely on using an autoID.

I am using MS Access (I could use MySQL if it would make life easier, but
not MS SQL Server as we do not have a licence for it)

Any help would be greatly appreciated !!!

regards,

Stuart
Jul 19 '05 #1
4 1346
What happens when you try to ORDER BY that column?

Ray at work

"Stuart" <st****@nowhere.co.uk> wrote in message
news:u4**************@TK2MSFTNGP10.phx.gbl...
This might be the wrong group (but it is my favorite)

I need to sort a list data from a text field into numerical order.

The data needs looks like this: -

a1
1
1a
2
3
4
29
29A
29X
25X
X25

However, the data could be put into the database in any order with additions by a user so I cannot rely on using an autoID.

I am using MS Access (I could use MySQL if it would make life easier, but
not MS SQL Server as we do not have a licence for it)

Any help would be greatly appreciated !!!

regards,

Stuart

Jul 19 '05 #2
"Stuart" <st****@nowhere.co.uk> wrote in message
news:u4**************@TK2MSFTNGP10.phx.gbl...
This might be the wrong group (but it is my favorite)

I need to sort a list data from a text field into numerical order.

The data needs looks like this: -

a1
1
1a
2
3
4
29
29A
29X
25X
X25

However, the data could be put into the database in any order with additions by a user so I cannot rely on using an autoID.

I am using MS Access (I could use MySQL if it would make life easier, but
not MS SQL Server as we do not have a licence for it)

Any help would be greatly appreciated !!!

regards,

Stuart


Data in a referential database has no intrinsic order, it is determined by
the "order by" clause in your sql statement. E.g.:
"Select column1, colum2 from table1 ORDER BY column3"
--
John Blessing

http://www.LbeHelpdesk.com - Help Desk software priced to suit all
businesses
http://www.free-helpdesk.com - Completely free help desk software !
http://www.lbetoolbox.com - Remove Duplicates from MS Outlook
Jul 19 '05 #3
Ray,

the query and results are as follows

SELECT tblTimetables.TT_BOOKA, tblTimetables.TT_id,
tblTimetables.TT_WWWNumber
FROM tblTimetables
WHERE (((tblTimetables.TT_BOOKA)=True))
ORDER BY tblTimetables.TT_id, tblTimetables.TT_WWWNumber;
TT_WWWNumber
1
5
9
10
12
14
19
22
29
63
64
65
99
99
152
161
163
01
04
29A
5B
AL
CC
KC
SV
SV
SV
SV

As you can see from the list 01,04,29A,5B are out of order.

I was wondering if there is any jiggery pokery that can be done either in
the SQL statement or in ASP some how.

regards,

stuart

"Stuart" <st****@nowhere.co.uk> wrote in message
news:u4**************@TK2MSFTNGP10.phx.gbl...
This might be the wrong group (but it is my favorite)

I need to sort a list data from a text field into numerical order.

The data needs looks like this: -

a1
1
1a
2
3
4
29
29A
29X
25X
X25

However, the data could be put into the database in any order with additions by a user so I cannot rely on using an autoID.

I am using MS Access (I could use MySQL if it would make life easier, but
not MS SQL Server as we do not have a licence for it)

Any help would be greatly appreciated !!!

regards,

Stuart

Jul 19 '05 #4
I have found a quick fix

Next to the route number I have assinged an integer that is the same as the
numeric route number and for Alpha route numbers I have assigned a value of
1000.

I sort on the new integer column and then sort by the routenumber.

This produces an acceptable result. Probably not the best solution, but it
works!!

Stuart

"Stuart" <st****@nowhere.co.uk> wrote in message
news:u4**************@TK2MSFTNGP10.phx.gbl...
This might be the wrong group (but it is my favorite)

I need to sort a list data from a text field into numerical order.

The data needs looks like this: -

a1
1
1a
2
3
4
29
29A
29X
25X
X25

However, the data could be put into the database in any order with additions by a user so I cannot rely on using an autoID.

I am using MS Access (I could use MySQL if it would make life easier, but
not MS SQL Server as we do not have a licence for it)

Any help would be greatly appreciated !!!

regards,

Stuart

Jul 19 '05 #5

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

Similar topics

13
by: Wescotte | last post by:
Here is a small sample program I wrote in PHP (running off Apache 1.3.31 w/ PHP 5.0.1) to help illustrates problem I'm having. The data base is using DB2 V5R3M0. The client is WinXP machine using...
3
by: Brian Oster | last post by:
After applying security patch MS03-031 (Sql server ver 8.00.818) a query that used to execute in under 2 seconds, now takes over 8 Minutes to complete. Any ideas on what the heck might be going...
1
by: Jeff Blee | last post by:
I hope someone can help me get this graph outputing in proper order. After help from Tom, I got a graph to display output from the previous 12 months and include the average of that output all in...
8
by: Adam Louis | last post by:
I would like help resolving this problem. I'm a novice who's been hired to query a hospital database and extract useful information, available to me only in a dynamically generated, downloadable...
6
by: Martin Lacoste | last post by:
Ok, before I headbutt the computer... don't know why when I add criteria in a query, I get an 'invalid procedure call'. I also don't know why after searching the help in access, the various access...
4
by: Apple | last post by:
1. I want to create an autonumber, my requirement is : 2005/0001 (Year/autonumber), which year & autonumber no. both can auto run. 2. I had create a query by making relation to a table & query,...
11
by: Andy_Khosravi | last post by:
My problem: I'm having trouble with a query taking much too long to run; a query without any criteria evaluating only 650 records takes over 300 seconds to run (over the network. On local drive...
4
by: Konrad Hammerer | last post by:
Hi! I have the following problem: I have a query (a) using another query (b) to get the amount of records of this other query (b), means: select count(MNR) as Number from...
4
by: Stan | last post by:
I am using MS Office Access 2003 (11.5614). My basic question is can I run a query of a query datasheet. I want to use more that one criteria and can not get that query to work. I thought I...
2
by: existential.philosophy | last post by:
This is a new problem for me: I have some queries that open very slowly in design view. My benchmark query takes about 20 minutes to open in design view. That same query takes about 20 minutes...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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...

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.