Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,656 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Good Morning,
I have two fields
tran_in (deatetime) = "2020-09-21 15:42:39.000"
tran_desc2 (char(30)) = "00:03:59"
I need to add these two fields
Thank you !!!
Declare @Sample Table(tran_in datetime, tran_desc2 char(30));
Insert @Sample(tran_in, tran_desc2) Values('2020-09-21 15:42:39.000', '00:03:59')
Select tran_in, tran_desc2, DateAdd(second, DateDiff(second, '19000101', tran_desc2), tran_in) As SummedDate
From @Sample;
Tom
Check a sample:
declare @example as table ( tran_in datetime, tran_desc2 char(30) )
insert into @example values ( '2020-09-21 15:42:39.000', '00:03:59' )
select *,
tran_in + tran_desc2
from @example