Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
wided
Posting Yak Master
218 Posts |
Posted - 2015-02-16 : 09:41:22
|
there is a finction that allows me to directly add hours, minutes, seconds to my initial date: example:date1 = '2014-05-16 06: 56: 23,000'I want to add on that date: 12:22:06(12 hours 22 minutes 6 seconds)thanks |
|
mhorseman
Starting Member
44 Posts |
Posted - 2015-02-16 : 10:02:01
|
declare @date1 datetimeset @date1 = '2014-05-16 06: 56: 23.000'select dateadd(ss,6,dateadd(mi,22,(DATEADD(hh,12,@date1))))Mark |
|
|
wided
Posting Yak Master
218 Posts |
Posted - 2015-02-16 : 10:41:08
|
thanks mark |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2015-02-23 : 08:10:51
|
orselect @date1+'12:22:06'MadhivananFailing to plan is Planning to fail |
|
|
Bustaz Kool
Master Smack Fu Yak Hacker
1834 Posts |
Posted - 2015-02-23 : 15:32:39
|
select dateadd(ss, datediff(ss, 0, '12:22:06'), @Date1) Those who will not reason, are bigots, those who cannot, are fools, and those who dare not, are slaves. -Lord Byron, poet (1788-1824) |
|
|
|
|
|
|
|