SQL:
Gives 'Data Type Mismatch' because the 43.38 is delimited as a string, when it is infact a number.
But, this sql is automatically generated (the columns names and data in the WHERE clause comes from another table), so the loop that generates it just delimits everything.
Is there a delimiter that works for text and numbers? Or is there a way with SQL to see the data type of the Access field so I can only add quotes into the string if needed? Or is this a horrible and wrong way to generate SQL?
Thanks
Charli
Code:
SELECT COUNT(month) as c FROM pool WHERE [reg] = "GP06NHL" AND [litres] = "43.38" AND [fuel] = "NORMAL UNLEADED" AND [month] = #01/04/2009#
But, this sql is automatically generated (the columns names and data in the WHERE clause comes from another table), so the loop that generates it just delimits everything.
Is there a delimiter that works for text and numbers? Or is there a way with SQL to see the data type of the Access field so I can only add quotes into the string if needed? Or is this a horrible and wrong way to generate SQL?
Thanks
Charli
Comment