MySQL has quite a few other handy date/time functions as well Good place to bookmark http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
..:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -----Original Message----- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 14, 2005 10:00 AM To: CF-Talk Subject: RE: CF & mySQL date search query question Thanks ryan...it was actually posted to Sitepoint. :P mySQL does have the year/month/day functions and that should work great, thanks! And yeah...it is stored as a date/time field and not a string. <!----------------//------ andy matthews web developer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737 --------------//---------> -----Original Message----- From: Ryan Guill [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 14, 2005 8:54 AM To: CF-Talk Subject: Re: CF & mySQL date search query question I have to say that its sort of funny that you surrounded your cf tags with [php] but i suppose you probably cross posted this to a forum. Either way, try something like this : <cfif FORM.year IS NOT ""> AND YEAR(n.due_datetime) = '#FORM.year#' </cfif> <cfif FORM.month IS NOT ""> AND MONTH(n.due_datetime) = '#FORM.month#' </cfif> <cfif FORM.day IS NOT ""> AND DAY(n.due_datetime) = '#FORM.year#' </cfif> This is not tested, and i cant ever remember the differences in the database types, but you should have some sort of date type functions that will pull out the specific year month or day from a date and compare it. It will slow things down, but not any slower than doing a LIKE. If it doesnt work, you might need to make sure you are storing it in the db as a timestamp, not a string. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227009 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54