Coldfusion and Access
Sometimes Coldfusion can be a bit of a challenge. This week I struggled with a formatting problem with some code that was returning the following error message:

[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.

I suspected a formatting problem in a date/time field I was using and as it turns out, I was right. The best link I could find addressing the problem is here.

The actual fix, since I don't have access to the root of the server I'm using, is to format the date/time the way MS Access wants it. I had a devil of a time finding the correct syntax, but it is this:

#DateFormat(Recordset1.StartTime,'MM/DD/YYYY')&' '&TimeFormat(Recordset1.StartTime,'HH:mm tt')#

Seems simple enough, eh? The first few times I went looking for this I ran across the correct answer given with an incorrect example. Ugh!

Archives