Usually I can sort out most issues in SQL but this one has me stumped!
I am doing a select from a table (actually, it's a large select from multiple tables, but I've narrowed down the source of the error to one specific field/table.)
In the WHERE clause is a line that read as follows:
AND ls.LNLCBL = 500
That field is a decimal field, so it stores nothing but numbers. And I've tried the 500 with an without a decimal and with and without surrounding quotes.
But whenever I run the script with that line in it, I get the following error:
"Conversion failed when converting the varchar value 'R' to data type int."
There is no "R" anywhere in that field. That is no varchar of any type in that field. And if I comment out that clause, the script runs fine - so it is certainly that clause that is causing the error.
Does that make sense to any of you? I...