Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 system variable in sql
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

AskSQLTeam
Ask SQLTeam Question

USA
0 Posts

Posted - 12/05/2002 :  07:35:06  Show Profile  Visit AskSQLTeam's Homepage  Reply with 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."

harshal_in
Aged Yak Warrior

India
633 Posts

Posted - 12/05/2002 :  07:47:34  Show Profile  Visit harshal_in's Homepage  Send harshal_in a Yahoo! Message  Reply with Quote
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
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000