Data type mismatch in criteria expression.

  • Thread starter Thread starter NathanJ
  • Start date Start date
N

NathanJ

Update tblTour SET TourName = 'Honduras',TourLength = '10
Days',TourDescription = 'We will be chartering a live aboard boat with
12 fellow divers off the coast of Hunduras. We can expect to see sever
different marine life as we will be making 5 dives per day and one at
night. There will be several sunken reefs for us to checkout as well.
There is an on board cook and house keeper. There will be a dive
briefing before all dives. This Tour is reserved for experienced divers
only.',TourLocation = 'Hunduras',TourPrice = '2999',TourPic =
'../pics/sunkenreef.jpg' WHERE TourID_pk = '1';

Thats the SQL statement.

Here are the datatypes:

TourName: text 50
TourLength: text 50
TourDescription: Memo
TourLocation: text 50
TourPrice: Currency
TourPic: text 50

I get the error:
Data type mismatch in criteria expression.

These are all valid entrys manually, but for some reason I can't get it
to work with an update query.

Any help is much appreciated.
 
When you want to insert values into a text type field, you need to put the
values in single quote as you did.
But the TourPrice field is currency (number) so it doesn't need the single
quote
Yours
TourPrice = '2999'

Need to be
TourPrice = 2999
 
One more thing, you didn't specify the type of the TourID_pk field, if it's
number change the where condition also to be without the single quote

WHERE TourID_pk = 1
 
Sounds like TourID_pk is a numeric type field. If so get
rid of the quotes arount the criteria value.

. . . WHERE TourID_pk = 1
 
Back
Top