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

  • SEARCH
  • Home
  • 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 8429259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:17:09+00:00 2026-06-10T05:17:09+00:00

I am currently creating a website on which I can add videos. When I

  • 0

I am currently creating a website on which I can add videos. When I add a video, I need to give a release date, formatted like: “21-09-2012”.

Now, when I use the simple ORDER BY command, it only sorts on the first two digits.

Does anyone know how can I fix this?

  • 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-06-10T05:17:10+00:00Added an answer on June 10, 2026 at 5:17 am

    It sounds like you are storing your date field as a string instead. If that it the case then you will need to convert the value to a date before trying to order it:

    SELECT  STR_TO_DATE(yourdate, '%d-%m-%Y')
    FROM    yourtable
    

    MySQL documentation on STR_TO_DATE

    However, you should be storing your dates in a date datatype and not as a string value. Then you will not have to perform these types of conversions.

    You can also do the conversion in the ORDER BY statement itself:

    order by STR_TO_DATE(yourdate, '%d-%m-%Y')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a video sharing website in django. Currently, if a user registers, and
I'm currently creating a PHP website where users need to be able to upload
I am currently creating a PHP website which allows administrators to upload a variety
I'm currently creating a website for a social project in switzerland. And before there
I am currently creating a type of classifieds website, and when the user enters
I'm currently building a website (ASP.net c#) and we're looking at creating a live
I am creating a website which uses jquery scrolling as the method of navigation
I am currently creating a script to synchronize users from our company's website onto
I am currently creating a one page website, however I am having an issue,
I am creating a search engine for my php based website. I need to

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.