SQLScholar
Programmer
Hey all.
This is the current where criteria i have on a query
I am getting an Error converting data type varchar to numeric.
So.... i changed there where to
And i get through... none!
If i removing the numeric casting off the first where it runs ok - just isnt correct.
So why if there is no non numerics - cant i cast as numeric?
Dan
----------------------------------------
Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind - Dr. Seuss
Computer Science is no more about computers than astronomy is about telescopes - EW Dijkstra
----------------------------------------
This is the current where criteria i have on a query
Code:
WHERE
cast(LEFT(CAST(CONVERT(varchar, DATEADD(d, 14, @RunDate), 103) AS varchar), 2) as numeric) = cast(policytables.[Collection Date] as numeric)
I am getting an Error converting data type varchar to numeric.
So.... i changed there where to
Code:
WHERE
(Isnumeric(LEFT(CAST(CONVERT(varchar, DATEADD(d, 14, @RunDate), 103) AS varchar), 2)) = 0
OR
ISNUMERIC (policytables.[Collection Date])=0)
And i get through... none!
If i removing the numeric casting off the first where it runs ok - just isnt correct.
So why if there is no non numerics - cant i cast as numeric?
Dan
----------------------------------------
Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind - Dr. Seuss
Computer Science is no more about computers than astronomy is about telescopes - EW Dijkstra
----------------------------------------