Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, All, Anybody know how to get

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi, All,

Anybody know how to get "date" around year?
Example: date1(07/02/01). I want to create field "DeadLine(07/02/02)". Would you please tell me how to write stored proceure to get field "DeadLine" depend on "date1"?
 
the DATEADD function will work


select DATEADD(yy,1,"07/02/01")

returns

---------------------------
2002-07-02 00:00:00.000

(1 row(s) affect
 
Hi there,
Try to use following snippet.
------------------------------
CREATE PROCEDURE myProc
(@myDate DATETIME=getdate(), @retString VARCHAR(50) OUTPUT)
AS
SELECT @retString="DeadLine ("+
convert(char(10),dateadd(yy,1,getdate()),101)+")"
------------------------------

If you find any problem let use know.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top