I have a problem with a varchar field that has been used to store dates. This was not originally my project and I have no idea what problems converting the field would cause.
My problem is, I need to query between 2 dates. Here's my current query:
And here's the error I get when I run it:
ODBC Error Code = 22005 (Error in assignment)
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the varchar value '08/24/2002 10:45:18' to a column of data type int.
SQL = "SELECT * FROM VIEW_Entry_TodaysNotes WHERE CreatedDate between 08/30/2005 and 08/23/2005 AND OrgID = '106'"
Can I convert the CreatedDate field in the query and if so how?
Thanks.
My problem is, I need to query between 2 dates. Here's my current query:
Code:
<CFQUERY name="Betweendates" datasource="datasource">
SELECT * FROM
VIEW_Entry_TodaysNotes
WHERE CreatedDate between #DateNow# and #Dateminusformat#
AND OrgID = '#ORGID#'
</cfquery>
ODBC Error Code = 22005 (Error in assignment)
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the varchar value '08/24/2002 10:45:18' to a column of data type int.
SQL = "SELECT * FROM VIEW_Entry_TodaysNotes WHERE CreatedDate between 08/30/2005 and 08/23/2005 AND OrgID = '106'"
Can I convert the CreatedDate field in the query and if so how?
Thanks.