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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Help me again!

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-integer
Procedure is:
Create Procedure--
@EDate datetime output
as
select @EDate=???
from table

Plz help me again coz i never used DATEADD Function previously.
Thanks alot.

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2008-07-17 : 10:34:14
before it got all confused with the errors regarding your datatypes. khtan showed you the dateadd function here...
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=106768

...and have you tried Books Online?

Em
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-07-17 : 10:37:28
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]

Go to Top of Page

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]



Go to Top of Page

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.
Go to Top of Page

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.
Go to Top of Page

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]

Go to Top of Page
   

- Advertisement -