Normally a data type mismatch error message (or design alert) is generated when your SQL is trying to populate an Integer answer with a string variable. It's possible that the difference can be more subtle than this.

The particular set of circumstance described here is pretty rare, and is only likely to happen by accident, but it might be useful to know about them.

If the answer you are trying to pre-populate has a numeric answer type you'll get a data type mismatch error if you try to populate it with an integer value.

When you define a reference table you choose whether each of the columns is numeric or string. If you choose numeric, and if the column contains decimal places, the column is treated as a numeric variable, if it doesn't its treated as an integer variable.

This means if you try to populate a numeric answer from a reference table column containing no entries with decimal places you'll get a data type mismatch error message. The same will happen if your reference table contains even a single entry with decimal places and your answer is defined as an integer, even if the values after the decimal points are zeros!

So, if you need to use a numeric answer type, make sure at lease some of the values in your reference table include decimal places.

if you create your reference table in Microsoft Excel and the data doesn't already have decimal places you'll need to format the column to show decimal places, otherwise when you enter (say) 1.0 Excel will automatically strip off the .0. You may have similar issues in other spreadsheets.