The Dev Pages

A knowledge base for web applications development (and beyond)




[Macromedia][SQLServer JDBC Driver]Value can not be converted to requested type.

If you have a string column that contains a null value, this occurs. You have to add a check for the null first. Note that the like clause is also case sensitive for query of queries.

Breaks:

SELECT * FROM myTable
WHERE 1=1
AND LOWER(name) LIKE <cfqueryparam cfsqltype=”cf_sql_varchar” value=”%#LCase(searchCriteria.search)#%” />

Works:

SELECT * FROM myTable
WHERE 1=1
AND name is not null AND LOWER(name) LIKE <cfqueryparam cfsqltype=”cf_sql_varchar” value=”%#LCase(searchCriteria.search)#%” />

Add A Comment