Lee, IF you are using Version 4.1.1 or higher, you can use the STR_TO_DATE() function.
WHERE STR_TO_DATE(DEPART_DATE, '%c/%e/%Y') You will need to consult the MySQL documentation for more info on the date formatting options. http://dev.mysql.com/doc/mysql/en/Date_and_time_functions.html about 1/3 the way down is a tbale describing the opotions. On Thu, 28 Oct 2004 11:15:20 -0400, Les Mizzell <[EMAIL PROTECTED]> wrote: > I don't know why I have so much trouble with this.. > > OK, I need to get all records with a depart date starting today and for > the next 15 days... > > So, first set the variables... > > <cfset TodayDate = #CREATEODBCDATE(now())#> > <cfset FutureDate = #CREATEODBCDATE(now() + form.departdate)#> > <!--- form.departdate is a simple number showing number of days in the > future - 15, 30, 45. ---> > > ...and then it seems this should work in the query: > > WHERE DEPART_DATE >= #TodayDate# and DEPART_DATE <= #FutureDate# > > But, it isn't working. > > Problem 1: This database was handed to me to work with. It's mySQL. > "DEPART_DATE" is a varText field and all the dates in it are listed as > "8/15/2004". This is probably causing all my headaches. > > Simply switching the data type in the database doesn't work - the data > gets translated incorrectly. > > So, advise on how to best correct this problem and get the query to work > correctly? > > I'm only an idiot half the time... > > -- > Les Mizzell > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF community. http://www.houseoffusion.com/banners/view.cfm?bannerid=38 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:182848 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

