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
 Transact-SQL (2000)
 system variable in sql

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-12-05 : 07:35:06
mazmouzi writes "i'm writing an sql query ,i used in it dateadd function which is:
dateadd("m",-1,'02-dec-02')now i want to change this particular date to make it an variable date like when i want to use it,it will get the current date."

harshal_in
Aged Yak Warrior

633 Posts

Posted - 2002-12-05 : 07:47:34
quote:

mazmouzi writes "i'm writing an sql query ,i used in it dateadd function which is:
dateadd("m",-1,'02-dec-02')now i want to change this particular date to make it an variable date like when i want to use it,it will get the current date."



If I get u right u can use:
dateadd(mm,-1,getdate())
the getdate() function gets the current date.

Go to Top of Page
   

- Advertisement -