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 |
|
imranabdulaziz
Yak Posting Veteran
83 Posts |
Posted - 2007-06-07 : 23:17:27
|
| Dear all, I am using Sql2005 Server. I want to know how can I find out next date in dd/mm/yyyy format by adding numric number to date . Say suppose I am adding 60 to today date that is 08/06/2007 I should get 06/08/2007.Is there any way to do it Please helpthanks |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-06-07 : 23:19:41
|
[code]select dateadd(day, 60, getdate())[/code] KH |
 |
|
|
pbguy
Constraint Violating Yak Guru
319 Posts |
Posted - 2007-06-07 : 23:25:13
|
| search for 'Date functions' in the SQL server help file, it will give variuos date functions and what are all can be achieved with those.--------------------------------------------------S.Ahamed |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-06-08 : 10:22:03
|
quote: Originally posted by imranabdulaziz Dear all, I am using Sql2005 Server. I want to know how can I find out next date in dd/mm/yyyy format by adding numric number to date . Say suppose I am adding 60 to today date that is 08/06/2007 I should get 06/08/2007.Is there any way to do it Please helpthanks
You cant make any calculations on the formatted datesUse proper DATETIME datatype and use dateadd functionMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|