Hello @Vivek Komarla Bhaskar ,
Thanks for the question and using MS Q&A platform.
I tried this
Create table sinkasVarchar
(
Hit_DateTime varchar(100)
)
INSERT into sinkasVarchar(Hit_DateTime) values ('2022-12-01 00:04:00')
You are doing this
SELECT CAST(SUBSTRING(Hit_DateTime,0,10)As DATE)
And getting the below error
Msg 241, Level 16, State 1, Line 26
Conversion failed when converting date and/or time from character string.
Pl;ease do and this and this will solve the issue
SELECT CAST(SUBSTRING(Hit_DateTime,0,11)As DATE) from sinkasVarchar
Let me know how it goes .
Thanks
Himanshu
Please accept as "Yes" if the answer provided is useful , so that you can help others in the community looking for remediation for similar issues.