Query a date in a varchar field
I am trying to do a simple query...
Count the number of records in a particular month...
I use variables in the URL and use this query (in MSSQL)
SELECT recorddate FROM sometable
WHERE Year(recorddate) LIKE '#Url.year#'
AND Month(recorddate) LIKE '#Url.month#'
This should work in theory, I believe, but the problem is that the date field is varchar (though all records have a timestamp which has been added as:
<INPUT type="hidden" name="recordate" value="#Now()#">
I'm not that advanced in ColdFusion so I'm hoping someone can help me out... Is there a simple way to do this?
Thanks!
