Following on from my other questions "SQL code to extract 30mins from a varChar data type"
I can get the results I am after the code is a bit messy wondering if it can be done in one chunk without using a temp table.
running this select SeminarTime from dbo.SeminarSMS gives this Output:
running the below code gives the desired results just wondering if it could be written better and without using a temp table:
set dateformat dmy
select cast (SeminarTime as datetime) as SeminarTime
, dateadd (minute, - 30, SeminarTime), 108) as Time1
, CONVERT(VARCHAR(5), SeminarTime, 108) as Time2