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 7859283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:51:29+00:00 2026-06-02T21:51:29+00:00

I have inherited a MySQL database which (for historical reasons) contains a field which

  • 0

I have inherited a MySQL database which (for historical reasons) contains a field which stores a date as number of days since 1900-01-01. I want to be able to select a date_format() version of this date but can’t figure a way of doing so.
Is there a way of manipulating the contents of the column such that I can pass the manipulated value to date_format() so it is recognised as a valid date?
I realise there is a solution to this which involves doing one query, then manipulating the field (in PHP) then passing back in as a secondary query – but I need this to be a single query solution.

  • 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-02T21:51:32+00:00Added an answer on June 2, 2026 at 9:51 pm

    Is the MySql FROM_DAYS() function what you’re looking for – see here for docs?

    However, depending on your database design and use case, you might consider adding a column with the date (result of FROM_DAYS()), so that you can do queries against that column. When you have to apply a function to a column before being able to use this in a query, it should ring warning bells that these queries could be quite inefficient to run.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table with a field which contains strings in my MySQL database.
I have a mysql database which as one of the fields contains a html
I have a mysql database. I have a column named id which is also
I have a project in which I'm accessing a MySql database on my web
I have a php code which generates a list from a field in mysql
I have a table in my database which contains all of the users for
I have a dataset which contains a string key field and up to 50
I have a mysql database which I support using phpMyAdmin. The website this is
I Have created a form, which inserts data into a MySQL database. Here are
I have a mysql database that contains snippets of latex code, identified by a

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.