Hi,
Please find the code below.
CREATE TABLE MyTable
(
BatchFileID INT IDENTITY,
LineItemValue NVARCHAR(256)
)
INSERT MyTable
SELECT 'EFC'
UNION
SELECT '3456.5070'
UNION
SELECT '253434.5670'
UNION
SELECT '345.5070'
UNION
SELECT '1234.5670'
select * from MyTable
WHERE
--CAST(LineItemValue AS NUMERIC(28,5))=1234.5670 AND
LineItemValue NOT LIKE '%E%'
AND ISNUMERIC(LineItemValue)=1
select * from MyTable
WHERE
CAST(LineItemValue AS NUMERIC(28,5))=1234.5670 AND
LineItemValue NOT LIKE '%E%'
AND ISNUMERIC(LineItemValue)=1
DROP TABLE MyTable
I am unable to reproduce the scenario for float. once i reproduce i will post the code back.
But above code for converting nvarchar to numeric should work. Just wanted to know why it is not working.
Thanks,
Vijay