I want to convert below Oracle query into SQL server environment-
select to_date(substr(to_char(col1, 'YYYYMMDD HH24MISS),1,8), 'YYYYMMDD') from tab;
From the above query i want to convert it into first time in Date format and then second time Time format. It means two times i want this query while above one in Date format.