Oct 20 2024 11:09 PM - edited Oct 20 2024 11:10 PM
update Database.dbo.tbl_Traditional_OR
set EntryDate=CONVERT(datetime, substring(BillNo,5,12), 112)
Where EntryDate is null
i found below error
Msg 241, Level 16, State 1, Line 19
Conversion failed when converting date and/or time from character string.
please help me. i am a fresher. i am using sql server 2014
Oct 21 2024 02:33 AM - edited Oct 21 2024 02:34 AM
Change substring(BillNo,5,12) to substring(BillNo,5,8) and try again.
If still fail, please post result of this SQL
SELECT BillNo
FROM Database.dbo.tbl_Traditional_OR
WHERE EntryDate IS NULL
Oct 21 2024 03:22 AM
Conversion failed when converting date and/or time from character string.
@gkibria29 then your source data contains a not-convertable string.
Have you some sample data for us?