problem sorting a date column

M

Middletree

Using ASP 3.0, I give the user the ability to create a spreadsheet with a
click. In the resulting spreadsheet, I have 2 columns which contain dates,
and which were created by almost exactly the same code, yet they behave
differently when I try to sort.

First, go to http://www.middletree.net/get.htm and right-click and save the
Excel file, then open it.

Note that the dates in both the Open Date and the Last Modified column look
pretty similar. Now, move the cursor so that you aren't accidentally
highlighting an entire column or anything. From the Excel menu, select Data,
then Sort. In the box that comes up, tell it that you want to sort by TSE,
then by Last Modified.

When you do this, you'll see that the TSE part is correct. However, the
LastModified date is out of order. Specifically, there are some 2005 dates
surrounded by 2006 dates.

Interestingly, this problem doesn't seem to occur in the Open Date column. I
have spent a lot of time looking at my ASP code, but I don't see how these
two columns were built any differently.

Ar any rate, how can I make this so that the dates are sorted correctly?
 
P

Phatchef24

Middletree,

What your problem is Column D (Last Modified) isn't a date. It ha
an extra blank after the year so excel wont recogize the value as
date (even after formatting). Just highlight column D, hit Ctrl+H an
replace any spaces with nothing
 
M

Middletree

That was it! I had a space in the ASP/HTML code. I took that out, and the
issue is resolved.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top