Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 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 November 4th, 2005, 01:13 AM
Authorized User
 
Join Date: Jun 2005
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sorting problem

Hi All,

i would like ask if i want to sort the table by DateModified, but it onlycompare for the day, not for the whole string(02/11/05), what i should add into my code to fix this problem?
It is because i want to list the table where the latest record on the top.
Please someone help me about this!!!!!!
Thanks!!

Reply With Quote
  #2 (permalink)  
Old November 4th, 2005, 02:42 AM
Wrox Author
Points: 183, Level: 3
Points: 183, Level: 3 Points: 183, Level: 3 Points: 183, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: Vancouver, Washington, USA.
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is this what you want to do?

select name, productnumber, ModifiedDate from Production.Product
order by Day(ModifiedDate)

This sorts only by the day number regardless of the year and month. You could also add:

order by Month(ModifiedDate), Day(ModifiedDate)

Paul Turley, MCSD, MCDBA, MCT, MSF Practitioner
Reply With Quote
  #3 (permalink)  
Old November 7th, 2005, 03:36 PM
Friend of Wrox
 
Join Date: Aug 2004
Location: Orange County, CA, USA.
Posts: 385
Thanks: 0
Thanked 0 Times in 0 Posts
Default

you may want to do datediff where < 1?

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
Collapsible table sorting problem sendkamal Javascript 0 February 27th, 2007 12:33 PM
Sorting problem (Paging) pat123 XSLT 9 January 30th, 2007 01:00 PM
Large Text Sorting Problem shellhb ASP.NET 1.0 and 1.1 Basics 0 October 27th, 2005 02:46 PM
Sorting Problem whiterainbow BOOK: Access 2003 VBA Programmer's Reference 4 June 6th, 2005 12:59 AM
Difficult sorting problem sunjammer XSLT 0 July 1st, 2003 11:34 PM



All times are GMT -4. The time now is 02:52 PM.


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