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 |
kwikwisi
Constraint Violating Yak Guru
283 Posts |
Posted - 2008-07-17 : 10:31:37
|
I already asked regards on DATEADD function.But i also want to know how can i get expiry date (that will be SDate+Mth)?SDate-datetime,Mth-integerProcedure is:Create Procedure--@EDate datetime outputasselect @EDate=???from tablePlz help me again coz i never used DATEADD Function previously.Thanks alot. |
|
elancaster
A very urgent SQL Yakette
1208 Posts |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
kwikwisi
Constraint Violating Yak Guru
283 Posts |
Posted - 2008-07-17 : 10:45:21
|
As i understand ,i write like that @EDate=AddDate(month,-NumMth,SDate)Plz correct me if i write wrongly.(NumMth is int,SDate is datetime)quote: Originally posted by khtan the Books Online gives a very good explanation on dateadd()http://msdn.microsoft.com/en-us/library/ms186819.aspx KH[spoiler]Time is always against us[/spoiler]
|
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-17 : 12:01:31
|
quote: Originally posted by kwikwisi As i understand ,i write like that @EDate=AddDate(month,-NumMth,SDate)Plz correct me if i write wrongly.(NumMth is int,SDate is datetime)quote: Originally posted by khtan the Books Online gives a very good explanation on dateadd()http://msdn.microsoft.com/en-us/library/ms186819.aspx KH[spoiler]Time is always against us[/spoiler]
Have you really had a look at the article in the link? it says DATEADD not ADDDATE. Now correct your expression. |
 |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-07-17 : 13:23:30
|
quote: Originally posted by visakh16
quote: Originally posted by kwikwisi As i understand ,i write like that @EDate=AddDate(month,-NumMth,SDate)Plz correct me if i write wrongly.(NumMth is int,SDate is datetime)quote: Originally posted by khtan the Books Online gives a very good explanation on dateadd()http://msdn.microsoft.com/en-us/library/ms186819.aspx KH[spoiler]Time is always against us[/spoiler]
Have you really had a look at the article in the link? it says DATEADD not ADDDATE. Now correct your expression.
Classic one. |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-17 : 20:53:07
|
Unexplainable mistake when OP had actually uses the term DATEADD in the initial post  KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|
|