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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:39:56+00:00 2026-05-27T02:39:56+00:00

I want to store some dates into MySQL but those dates are without years

  • 0

I want to store some dates into MySQL but those dates are without years field.
What’s the best way to do it?

It’s best if I can utilize those two MySQL functions in my queries: DATE_SUB(), DATE_ADD(); because I want to query date spans that covers the current MM-DD.

ADD:

  1. I have 100% control over the input and output code;
  2. I have two MM-DD dates in a row to represent a date span
  3. I’m not intending to save space by doing this, but I’m doing this just because in my requirements I need to store important MM-DD dates and return the date span that covers current MM-DD no matter what year it is now, it’s like a “holiday reminder” or something like that
  • 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-27T02:39:57+00:00Added an answer on May 27, 2026 at 2:39 am

    If you have 100% control over all the code that directly reads or writes this data, you could just use a normal DATE field, and always set the year to the same constant value.

    Then, you can use DATE_ADD() etc. in your queries normally, you just have to omit the year whenever you return some of those dates.

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

Sidebar

Related Questions

I store some dates in my NSMutableArray, I want to retrieve them and change
I want to store some value from SQLite database in my buffer, but the
I store some data in MySQL and want to filter out rows that match
i want to save some text into my database with foloowing code. But i
I want to store the current data/time and the Button Id into some file.
I want to store some data during my site viewing. Sometime i need to
I want to use session object in my web app.I want to store some
Is this possible? Situation is that I want to store some XML in my
I want to temporary store some mapping data. The mapping is one to one.
I want to store null for some of the keys in HttpRuntime.Cache as I

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.