# Date Format is now text?

**URL:** <https://forum.kirupa.com/t/date-format-is-now-text/211168>\
**Category:** programming\
**Created:** [December 28, 2006, 4:54am UTC](https://forum.kirupa.com/t/date-format-is-now-text/211168 "2006-12-28T04:54:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashermx](https://avatars.discourse-cdn.com/v4/letter/f/e5b9ba/32.png) [@flashermx](https://forum.kirupa.com/u/flashermx)\
**Post date:** [December 28, 2006, 4:54am UTC](https://forum.kirupa.com/t/date-format-is-now-text/211168/1 "2006-12-28T04:54:54Z")

</div>

I have a MySQL table containing a date column that is formatted as per MySQL  
year-month-day

In creating a search form I developed a sql query to poulate a drop-down list containing all available months refomatted the way I want. See below:

SELECT DISTINCT DATE\_FORMAT(sweventcalendar.eventdate, ‘%M’) AS fomattedeventmonth  
FROM sweventcalendar  
WHERE sweventcalendar.eventdate \>= NOW()

However, when I pass the form variable, the selection from the drop-down list, which is called eventmonth, using the GET action, I get no results.

I know my querry works if I remove the date format from the code above.

My querry results is coded as follows:

SELECT sweventcalendar.eventtitle, sweventcalendar.eventdesc, sweventcalendar.eventurl1, sweventcalendar.eventurl2, sweventcalendar.eventurl3, DATE\_FORMAT(sweventcalendar.eventdate, ‘%M %e, %Y’) AS fomattedeventdate  
FROM sweventcalendar  
WHERE eventdate = colname

/\*colname is a date type with a default value of -1 and a run time value of $\_GET[‘eventmonth’] \*/

Any help would be appreciated.

PS: is there something with the way I formated the date in setting up the form element that removes its value?

🔗
