Cast () Failure on blank field?
Posted on 2006-05-01
Here's my SQL statement
SELECT KPI.[Column 2] AS Store, KPI.[Column 3] AS Date, CAST(KPI.[Column 5] AS numeric(12, 2)) - CAST(TestKPI.[Column 5] AS numeric(12, 2)) AS Difference,
KPI.[Column 5] AS Production, TestKPI.[Column 5] AS Test
FROM KPI INNER JOIN
TestKPI ON KPI.[Column 2] = TestKPI.[Column 2] AND KPI.[Column 3] = TestKPI.[Column 3]
ORDER BY Date
The syntax is correct(I used it with different fields without any issue), but for some reason the cast() function is choking on blank fields? I'm not sure how to compenstate for this, but I'm pretty sure it must be an esay fix that I'm missing. I could do it is access without an issue, but SQL is tripping me up.
Thanks in advance.