I am adding dates into my MySQL database using a form. The column has a data type of datetime, with a column name of _date.
To output my data I am using this code:
<cfoutput>
<cfquery name="vehiclelogDate" datasource="#datasource#">
select ID, '_date'
from vehicle_log
where vehicle_id = <cfqueryparam value="#url.id#">
order by _date ASC
</cfquery>
<cfset fist_year = DATEPART("yyyy",'#vehiclelogDate._date#')>
#first_year#
</cfoutput>
When I do that I recieve the error: The value _date cannot be converted to a date.
I recently converted from an Access test database to MYSQL and now this error has appeared.
Can someone help?