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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:15:38+00:00 2026-06-03T11:15:38+00:00

I have a table in MySQL with a field of type DATE for storing

  • 0

I have a table in MySQL with a field of type DATE for storing some dates, and I have another table in which I have a field of type SMALLINT for storing only a year.

Now I need to differentiate between a date (or a year) that is simply unknown from a date (or a year) that hasn’t occurred yet. It’s pretty straightforward that unknown values should be NULL. But is there any recommendation as to what value to use to store dates that haven’t yet occurred with the types I mentioned?

I’m quite sure that no dates / years before 1000 will ever be used, so I could use e.g. 0000-01-01. Is there any better / recommended solution?

EDIT Just read that for the DATE type “The supported range is ‘1000-01-01’ to ‘9999-12-31’.” So I would have to use 1000-01-01 instead of 0000-01-01.

  • 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-03T11:15:45+00:00Added an answer on June 3, 2026 at 11:15 am

    It sounds like you are trying to use one column to store two separate bits of data. Whether someone is dead or alive (effectively a status field) and the date on which they died are separate bits of info. As such, I’d suggest you store them separately. Whether someone is alive or dead without the date of their death being known, the date of death is NULL in either case. I wouldn’t use the date field to determine whether or not they are dead. Thus I would suggest a TINYINT (or BOOL) column to store whether they are alive or not and a NULL-able DATE field for their date of death.

    • 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 of type date within a MySQL database.
I have a mysql table field set as time type which stores data in
I have a table in MySQL 4.0 which currently has a year field as
I have a table abc with a field datetime_abc type-> DATETIME in mysql. and
I have a MySQL table which has a product_id field (big integer) 1102330008 1102330025
Hi I have a field in mySql table called jobnumber which auto increments with
I have a MySQL table where there is a 'date_added' (date) field, 'time_added' (time)
I have a table with a date field type date . What I am
I have MySQL table with the following structure: +---------+--------------+------+-----+---------+----------------+ | Field | Type |
I have this MySQL table: desc studentabsence; +---------------------------+-------------+ | Field | Type | +---------------------------+-------------+

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.