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 |
Muj9
Yak Posting Veteran
75 Posts |
Posted - 2014-09-09 : 09:25:31
|
Hi All,I have a Column 1 datetime and and column 2 int. i want to make a thrid column, column 3 datetime based on column 1 and Column 2.column 1 Column 2 2014-09-09 00:03:00.000 30 Expected Resultcolumn 1 Column 2 column 32014-09-09 00:03:00.000 30 2014-09-09 00:03:30.000Can Somebody help.thank you |
|
MichaelJSQL
Constraint Violating Yak Guru
252 Posts |
Posted - 2014-09-09 : 09:41:17
|
DATEADD(mi,[Column 2],[column 1]) AS [column 3] |
|
|
Muj9
Yak Posting Veteran
75 Posts |
Posted - 2014-09-09 : 09:45:14
|
Hi Thankyou for replying but i am getting the result below which is not correct.[column 1] [column 2] [column 3]2014-09-09 00:03:00.000 30 2014-09-09 00:33:00.000I have checked the other columns and yes this works but one record showen above is incorrect why is this the case.Thank you |
|
|
jeffw8713
Aged Yak Warrior
819 Posts |
Posted - 2014-09-09 : 14:42:49
|
That looks correct to me - you have 00:03, adding 30 minutes will be 00:33. |
|
|
|
|
|