0
votes

When I try to run the following INSERT INTO query, the following message comes up:

"Data Type Mismatch in Criteria expression"

I have had a look at all my fields and they are the same (Short text). I am wondering if it is the "Where condition". Do I need to have this field in my table where the information is being inserted into?

This is my INSERT CODE

INSERT INTO Fauna_ATT ( [Burn ID], [Burn Name], [Value Effected], [Pre Burn Action Details], [During Burn Action Details], [Post Burn Action Details] )
SELECT [Burn ID], [Burn Name], [Value Effected], [Pre Burn Action Details], [During Burn Action Details], [Post Burn Action Details]
FROM EPFP
WHERE ATT="TRUE";
1
I have taken out the "Where condition" and it seems to work fine. But I do need this condition in as I only want records copied over when there is an ATT required - Madison Read
What DB is this? Show also declaration of Fauna_ATT and EPFP - what is the type of ATT? - barbsan
That is invalid standard SQL. Which DBMS product are you using? - a_horse_with_no_name
Presumably the error message is saying that one of the columns has an incompatible type. That is where I would start looking for an issue. - Gordon Linoff
Why are you copying records and not just using a query? - June7

1 Answers

0
votes

Assuming ATT is a yes/no type field, don't use quote marks. TRUE and FALSE are intrinsic Boolean constants holding values of -1 and 0 respectively. If you enclose in text delimiters then the value is a literal string.

WHERE ATT=True

or

WHERE ATT=-1