SQLSoldier Jun 15th, 2017 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- Declare @DT varchar(35) = '1:30:21 PM 3/29/2017';
- Select Cast(Right(@DT, Len(@DT) - Charindex(' ', @DT, Charindex(' ', @DT) + 1)) +
- space(1) + LEft(@DT, Charindex(' ', @DT, Charindex(' ', @DT) + 1)) as datetime);
RAW Paste Data