sql – Operand type clash: int is incompatible with date + The INSERT statement conflicted with the FOREIGN KEY constraint

sql – Operand type clash: int is incompatible with date + The INSERT statement conflicted with the FOREIGN KEY constraint

This expression 12-4-2005 is a calculated int and the value is -1997. You should do like this instead 2005-04-12 with the before and after.

Try wrapping your dates in single quotes, like this:

15-6-2005

It should be able to parse the date this way.

sql – Operand type clash: int is incompatible with date + The INSERT statement conflicted with the FOREIGN KEY constraint

FYI this turned out to be an issue for me where I had two tables in a statement like the following:

SELECT * FROM table1
UNION ALL
SELECT * FROM table2

It worked, but then somewhere along the line the order of columns in one of the table definitions got changed. Changing the * to SELECT column1, column2 fixed the issue. No idea how that happened, but lesson learned!