Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

date order problem

LEGEND ,
Sep 24, 2006 Sep 24, 2006

Copy link to clipboard

Copied

Hi

I am trying to order a couple dates and i have no idea why this is not
working


SQL Statement
rs_events_cmd.CommandText = "SELECT * FROM events ORDER BY fromdate ASC"

Here are the dates from the database

fromdate
9/9/2006
9/16/2006
10/14/2006
10/21/2006
11/3/2006
9/22/2006
11/11/2006
11/12/2006


The order they show up on the page is kinda strange

10/14/2006
10/21/2006
11/11/2006
11/12/2006
11/3/2006
9/16/2006
9/22/2006
9/9/2006

Any help would be greatly appreciate.

Thanks


TOPICS
Server side applications

Views

193
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 24, 2006 Sep 24, 2006

Copy link to clipboard

Copied

Peter wrote:
> I am trying to order a couple dates and i have no idea why this is not
> working

Judging from your date format, it looks as though you're working with
Access, which permits you to insert dates in a variety of formats. The
sort order is numerical, rather than date order. I'm not very familiar
with the data types in Access, but it looks as though you haven't
defined the correct data type for the column.

--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 24, 2006 Sep 24, 2006

Copy link to clipboard

Copied

On 24 Sep 2006 in macromedia.dreamweaver.appdev, Peter wrote:

> I am trying to order a couple dates and i have no idea why this is
> not working
>
> SQL Statement
> rs_events_cmd.CommandText = "SELECT * FROM events ORDER BY fromdate
> ASC"
>
> Here are the dates from the database
>
> fromdate
> 9/9/2006
> 9/16/2006
> 10/14/2006
> 10/21/2006
> 11/3/2006
> 9/22/2006
> 11/11/2006
> 11/12/2006
>
>
> The order they show up on the page is kinda strange
>
> 10/14/2006
> 10/21/2006
> 11/11/2006
> 11/12/2006
> 11/3/2006
> 9/16/2006
> 9/22/2006
> 9/9/2006
>
> Any help would be greatly appreciate.

You don't say what kind of database it is. You also don't say what
kind of field you've entered the date into, but if it's anything other
than some sort of date field, then it's sorted correctly.

MySQL, for example, stores dates as yyyymmdd; formatting them on output
is relatively easy and is left for you, the database programmer.
Access and SQL Server are similar.

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/email.php

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 24, 2006 Sep 24, 2006

Copy link to clipboard

Copied

LATEST
Thanks guys



Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines