I think you may be missing some pound symbols as I am not aware that MySql has a datepart function.
Cheers, Dan On Feb 1, 2010, at 6:44 PM, Chad Veldhouse <cveldho...@vaagency.com> wrote: > > I am working on a simple query using DatePart. > I am running CF9 on a Mac with MySQL. > > The code looks like this: > <CFQUERY name="GetAgentLeads" datasource="#Application.Data#"> > SELECT SoldID, LeadID, AgentID, ProfileID, FirstName, LastName, > Price, Viewed, SoldDate > FROM SoldLeads > Where AgentID = #Session.AgentID# AND DatePart("YYYY",SoldDate) > ='#SearchYear#' > </CFQUERY> > > The code responds with "FUNCTION Data.DatePart does not exist ". > Very similar code works with CFMX6 & Access on a Windows machine. > I have tried DatePart(YYYY,SoldDate)-'#SearchYear#' & atePart > ('YYYY',SoldDate)-'#SearchYear#'. > Nothing seems to work. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330322 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4