ColdFusion · Database exception

Data Type Mismatch In Criteria Expression (Access)

What does Data Type Mismatch In Criteria Expression (Access) mean in ColdFusion?

Microsoft Access's JET/ACE engine throws this when a WHERE or GROUP BY comparison mixes incompatible types — a string literal compared against a numeric or date column, a GROUP BY that omits a column present in the SELECT list, or an implicit cartesian join created by missing JOIN conditions across multiple tables. Access is far less forgiving about implicit conversion than SQL Server or MySQL.

Data Type Mismatch In Criteria Expression (Access)Adobe ColdFusion

Condition

Microsoft Access's JET/ACE engine throws this when a WHERE or GROUP BY comparison mixes incompatible types — a string literal compared against a numeric or date column, a GROUP BY that omits a column present in the SELECT list, or an implicit cartesian join created by missing JOIN conditions across multiple tables. Access is far less forgiving about implicit conversion than SQL Server or MySQL.

Fix

Use cfqueryparam with the correct cfsqltype on every bound value so ColdFusion sends Access the type it expects, convert incoming date strings with parseDateTime() before comparing, and make sure every SELECT column also appears in GROUP BY.

Pending source verification. Not yet checked against official documentation.

Related database exception