Hello all... I'm using asp to get records from an access database, very
similar to the way datagrid would work. The title of each column in my table
is a link that alternates the sort order between ascending and descending...
my problem is that text WILL change its sort order just fine but nubers are
not always in order. ie: if sort order is ASC (ascending) I might see 2000,
234, 789 (should be ordered but its not). I'm guessing that ASP is handing
the string as a text string (?) and getting confused, is there a way to
force ASP into treating the string as numerals if this is the case? any
other ideas? Thanks so much.
here is one of my sql commands in case you want to see it. "sort" is a
variable containing the recordset to sort by depending on which link is
clicked. I hope I didn't confuse the whole issue because of a lack of
caffiene over here :)
strsql = "SELECT * FROM comments ORDER BY " & sort & " DESC"
Thanks of the help, much appreciated.
Eno 2 28248
What is the data type of the column containing the number?
--
Mark Schupp
--
Head of Development
Integrity eLearning
Online Learning Solutions Provider ms*****@ielearning.com http://www.ielearning.com
714.637.9480 x17
"Alpay Eno" <en*@spamsux.com> wrote in message
news:Mx********************@news4.srv.hcvlny.cv.ne t... Hello all... I'm using asp to get records from an access database, very similar to the way datagrid would work. The title of each column in my
table is a link that alternates the sort order between ascending and
descending... my problem is that text WILL change its sort order just fine but nubers
are not always in order. ie: if sort order is ASC (ascending) I might see
2000, 234, 789 (should be ordered but its not). I'm guessing that ASP is handing the string as a text string (?) and getting confused, is there a way to force ASP into treating the string as numerals if this is the case? any other ideas? Thanks so much.
here is one of my sql commands in case you want to see it. "sort" is a variable containing the recordset to sort by depending on which link is clicked. I hope I didn't confuse the whole issue because of a lack of caffiene over here :) strsql = "SELECT * FROM comments ORDER BY " & sort & " DESC"
Thanks of the help, much appreciated. Eno
> my problem is that text WILL change its sort order just fine but nubers
are not always in order. ie: if sort order is ASC (ascending) I might see
2000, 234, 789 (should be ordered but its not).
Looks like this "number" column is not numeric at all, but rather
CHAR/VARCHAR.
Try
ORDER BY CONVERT(INT, thatColumn)
Or try making the column a numeric data type, if it holds numeric data. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: David |
last post by:
sorry for the last post, itchy fingers.
I'm having a bit of difficulty sorting images named in sequential numerical
order. Here are the image names and how I need them sorted.
image1.jpg...
|
by: David |
last post by:
Hi all, A while back I asked how to sort an array of strings which would
have numerals and I wanted to put them in sequential numerical order.
For example:
myArray = "file1";
myArray =...
|
by: Leon |
last post by:
I have six textbox controls on my webform that allows the user to enter any
numbers from 1 to 25 in any order. However, I would like to sort those
numbers from least to greatest before sending them...
|
by: Steve Crawford |
last post by:
I am suffering some sort order confusion. Given a database, "foo",
with a single character(4) column of data left padded with spaces I
get:
select * from foo order by somechars;
somechars...
|
by: yeti349 |
last post by:
Hi, I'm using the following code to retrieve data from an xml file and
populate a javascript array. The data is then displayed in html table
form. I would like to then be able to sort by each...
|
by: adrian.chandler |
last post by:
Hi all,
I have been using letter and symbol codes such as GNU< GNU\ GNU}
GNUˆ in an Access table. I was surprised to see that when the table
was sorted on this field, the order is:
GNUˆ...
|
by: aarklon |
last post by:
Hi folks,
this is the program implementing quicksort
#include<stdio.h>
#include<stdlib.h>
#define swap(a,b){int t; t=a;a=b;b=t;}
int partition(int,int,int);
void quicksort(int,int,int);
|
by: Tony WONG |
last post by:
i have a number of forms with fax numbers to come up into arrays and then
combine to string.
after that i design the flow
1. break the string to array
now the string looks like this...
|
by: jmarcrum |
last post by:
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...
|
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: 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: 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...
|
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,...
|
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...
| |