Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6223599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:31:03+00:00 2026-05-24T08:31:03+00:00

I am trying to convert a Datetime from 29/07/2011 00:00:00 this from this format

  • 0

I am trying to convert a Datetime from 29/07/2011 00:00:00 this from this format to just 29/07/2011. I do this with a SELECT statement

SELECT CONVERT(nvarchar(10), thisDate, 103) As thisDate ... ORDER BY thisDate

This gives an order of something like this

01/08/2011
02/08/2011
05/06/2011
08/07/2011
14/07/2011
21/06/2010
21/07/2011
23/07/2011
24/07/2011
24/07/2011

However when I use 101 or 102 formatting the results are correct and the dates are ordered correctly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:31:04+00:00Added an answer on May 24, 2026 at 8:31 am

    Your solution doesn’t work because SQL server is trying to sort based on a text string which gets sorted alphabetically, instead of sorting by date.

    Try doing this to your query:

    SELECT CONVERT(nvarchar(10), thisDate, 103) As newDate, thisDate
    FROM YourTable
    ORDER BY thisDate ASC
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to convert varchar date value to datetime format. Showing error select
I am trying to convert a mysql DATETIME into this format m/d/y but the
I am trying to convert an access datetime field to a mysdl format, using
I want to get records from sql server 2005 in datetime format like this
DateTime dt = Convert.ToDateTime(dateTimePicker1.Text); //taken the DateTime from form string dt1 = String.Format(Y, dt);
I am trying to convert a datetime that is returning back from a soap
I'm trying to convert a string from to a Joda DateTime object. The date
i'm trying to convert following varchar date to datetime format but it doesn't work
I am trying to convert a string of this format: MM/dd/yyyy HH:mm The input
I am trying to convert all DateTime values in a DataTable to strings. Here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.