A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date Order in Crosstab Query



 
 
Thread Tools Display Modes
  #1  
Old May 4th, 2004, 01:24 AM
Bill
external usenet poster
 
Posts: n/a
Default Date Order in Crosstab Query

When I do a crosstab query, the dates do not come out in
ascending date order; for example:

1/12/2004
1/19/2004
1/26/2004
1/5/2004
12/29/2003

The above appears to be sorting left to right. it should
be as below:

12/29/2003
1/5/2004
1/12/2004
1/19/2004
1/26/2004

What's the problem?

Bill
  #2  
Old May 4th, 2004, 01:54 AM
Duane Hookom
external usenet poster
 
Posts: n/a
Default Date Order in Crosstab Query

If you are use dates as column headings, the values will sort as text
values. This means 12/31/2004 would appear before 2/1/2003.

--
Duane Hookom
MS Access MVP


"Bill" wrote in message
...
When I do a crosstab query, the dates do not come out in
ascending date order; for example:

1/12/2004
1/19/2004
1/26/2004
1/5/2004
12/29/2003

The above appears to be sorting left to right. it should
be as below:

12/29/2003
1/5/2004
1/12/2004
1/19/2004
1/26/2004

What's the problem?

Bill



  #3  
Old May 4th, 2004, 02:08 AM
John Vinson
external usenet poster
 
Posts: n/a
Default Date Order in Crosstab Query

On Mon, 3 May 2004 17:24:44 -0700, "Bill" wrote:

When I do a crosstab query, the dates do not come out in
ascending date order; for example:


Sounds like you may be using the Format() function to format the date;
doing so converts it from a Date/Time to a Text value (which will sort
alphanumerically not chronologically). Care to post the SQL if this
doesn't help?

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
  #4  
Old May 4th, 2004, 12:03 PM
Bill
external usenet poster
 
Posts: n/a
Default Date Order in Crosstab Query

Duane.

You are correct, I am using the date as a column heading.
I'll think about a fix; maybe turning the dates into
week1, week2, week3, .... weekN. If you have a slick
solution, I would appreciate your suggestions.

thanks. bill.

-----Original Message-----
If you are use dates as column headings, the values will

sort as text
values. This means 12/31/2004 would appear before

2/1/2003.

--
Duane Hookom
MS Access MVP


"Bill" wrote in message
...
When I do a crosstab query, the dates do not come out in
ascending date order; for example:

1/12/2004
1/19/2004
1/26/2004
1/5/2004
12/29/2003

The above appears to be sorting left to right. it should
be as below:

12/29/2003
1/5/2004
1/12/2004
1/19/2004
1/26/2004

What's the problem?

Bill



.

  #5  
Old May 4th, 2004, 01:20 PM
Duane Hookom
external usenet poster
 
Posts: n/a
Default Date Order in Crosstab Query

Bill,
Search Google Groups on my name and "Relative dates Mth0" for a solution. If
you can't find this or have questions, come on back.

--
Duane Hookom
MS Access MVP


"Bill" wrote in message
...
Duane.

You are correct, I am using the date as a column heading.
I'll think about a fix; maybe turning the dates into
week1, week2, week3, .... weekN. If you have a slick
solution, I would appreciate your suggestions.

thanks. bill.

-----Original Message-----
If you are use dates as column headings, the values will

sort as text
values. This means 12/31/2004 would appear before

2/1/2003.

--
Duane Hookom
MS Access MVP


"Bill" wrote in message
...
When I do a crosstab query, the dates do not come out in
ascending date order; for example:

1/12/2004
1/19/2004
1/26/2004
1/5/2004
12/29/2003

The above appears to be sorting left to right. it should
be as below:

12/29/2003
1/5/2004
1/12/2004
1/19/2004
1/26/2004

What's the problem?

Bill



.



  #6  
Old May 4th, 2004, 06:09 PM
Tim Ferguson
external usenet poster
 
Posts: n/a
Default Date Order in Crosstab Query

"Bill" wrote in
:

You are correct, I am using the date as a column heading.


Try formatting them in ISO form yyyy-mm-dd and they will sort correctly.


Tim F

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:46 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.