Jump to content

[SOLVED] Best way to pull only future dates from database?


blurredvision

Recommended Posts

I have a MySQL table that has a column for dates, and they are in this format: YYYY-MM-DD

 

The column has the DATE data type.  The database will always have dates older than today, but will only have at most 14 dates into the future for certain events.  What I'm wanting to do is populate a drop down box in one of my forms that will only show today's date along with any dates forthcoming.  Dates older than today I do not want.

 

So, for example, today is 2009-05-29.  I have a column with the following dates:

 

2009-05-21

2009-05-23

2009-05-28

2009-05-31

2009-06-02

2009-06-04

2009-06-07

 

From my explanation, I only want to bring back events that may happen today, as well as any future event dates.

 

What is the best way to go about this?  Let's just say that having the event dates in this format is the ONLY way that they can be entered into the database, so anything I do will have to use the above example format.

 

I appreciate any suggestions.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.