Hello ,

I'm trying to make an Update query but keep getting the following exception :
"Data type mismatch in criteria expression"

Here is the query :

UPDATE PatientData SET PatientData.[Transaction Stop Time]='6/26/2010 1:07:12 PM'
WHERE PatientData.[Patient ID]=6 AND PatientData.[Parameter name]= 'Temperature'
AND PatientData.[Valid start time]='9/7/1999 12:00:00 AM'

additionally, when i remove the last criteria everything works fine.

Any ideas?

Date time formats need to be in 'yyyyMMdd hh:mm:ss:fff' format.

try '19990907 12:00:00:000'

time will be in 24h format.

if you want to check for date like Update where the date is 07/09/1999 (dd/MM/yyyy)

you can do Where Date between '19990907' and '19990908'

This will get you all results with where the date is 07/09/1999 - 08/09/1999 will not come up provided time is floowed by the date.

Use tostring()

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.