Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 4th, 2005, 08:28 PM
Authorized User
 
Join Date: Dec 2004
Location: Las Vegas, NV, USA.
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default sort data

In a query, I have the following fields:
OrderNo.
CustomerName
Date
Price

I tried to sort the data by CustomerNamer whose OrderNo. has been sorted also. In the query, if I sort the Customer and OrderNo, but the OrderNo hasn't been sorted. Can anyone know the reason and how to fix it? Appreciated for any help!

flyfish
__________________
flyfish
Reply With Quote
  #2 (permalink)  
Old February 4th, 2005, 09:07 PM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Order number is numeric or text field? (I think it should be numeric).

can u paste the SQL query, which u are using?


Om Prakash
Reply With Quote
  #3 (permalink)  
Old February 6th, 2005, 02:32 AM
Authorized User
 
Join Date: Dec 2004
Location: Las Vegas, NV, USA.
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The type of orderID is text.
I created the query in the design view, I think I can view the query in SQL view. Here is the SQL view of the query:
SELECT tbl_order_summary.EmpoyeeID, tbl_order_summary.CompanyName, tbl_order_summary.OrderID, tbl_order_summary.OrderedDate
FROM tbl_order_summary
ORDER BY tbl_order_summary.CompanyName;

I am wonerding how can I sort the orderID also?

Thank you for your reply!

flyfish
Reply With Quote
  #4 (permalink)  
Old February 6th, 2005, 03:13 AM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

If you want to sort the numeric OrderID (and if it is all numeric, then you can use convert(int,OrderID) in order by clause. but this will give u error when there is text content).


Om Prakash
Reply With Quote
  #5 (permalink)  
Old February 6th, 2005, 09:13 PM
Authorized User
 
Join Date: Dec 2004
Location: Las Vegas, NV, USA.
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I still do not know why I can only sort one field in the query, even if I tried to sorted the data by CustomerName and Date. After I run the query, only the leftmost column has been sorted. Why?

Appreciated for any replies!

flyfish
Reply With Quote
  #6 (permalink)  
Old February 7th, 2005, 02:51 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: , , Finland.
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

Set both fields sorting ascending. Here is the SQL syntax

SELECT tbl_order_summary.EmpoyeeID, tbl_order_summary.CompanyName, tbl_order_summary.OrderID, tbl_order_summary.OrderedDate
FROM tbl_order_summary
ORDER BY tbl_order_summary.CompanyName, tbl_order_summary.OrderedDate;

-vemaju

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to sort data in a data grid? zaheerabbas.sk ASP.NET 1.0 and 1.1 Basics 3 April 10th, 2007 02:37 PM
dynamic sort - data-type (using xsl2.0 with saxon) ronisc XSLT 2 December 5th, 2006 05:39 AM
datagrid does SORT integer data properly chayanvinayak Flash (all versions) 3 July 27th, 2006 02:59 PM
How to sort a column in data grid: kenn_rosie ASP.NET 1.0 and 1.1 Basics 1 January 26th, 2006 02:03 PM
trying to sort data in excel with vb.net deanna VB How-To 0 March 26th, 2004 04:25 PM



All times are GMT -4. The time now is 09:19 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.