Can anyone help with this query?
SELECT TOP (200) Material, Plant, StorLocation, Batch,
LEFT(Batch, 1),
CASE WHEN LEFT(Batch, 1) <> '0' THEN
Batch
ELSE
CONVERT(INT, Batch)
END AS BATCH,
MaterialDescription, SLDays, Days, SLEDBBD, Unrestricted, BUn, Location, Status
FROM ZMB5M
WHERE BATCH = '67918688Q0'
But it return an error :
Msg 245, Level 16, State 1, Line 2
Conversion failed when converting the nvarchar value '67918688Q0' to data type int.
Batch is in nvarchar, and i want to remove data in batch that have some '0' in start of data Thanks..