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
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 getdate() - date
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pascal_jimi
Posting Yak Master

Azerbaijan
167 Posts

Posted - 10/10/2013 :  07:18:01  Show Profile  Visit pascal_jimi's Homepage  Reply with Quote
hi
i have a table

a1
-----
id t1

How can I calculate the difference between getdate() and t1 how many days


http://sql-az.tr.gg/

madhivanan
Premature Yak Congratulator

India
22864 Posts

Posted - 10/10/2013 :  07:24:00  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
select datediff(day,t1,getdate()) from table

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

pascal_jimi
Posting Yak Master

Azerbaijan
167 Posts

Posted - 10/10/2013 :  07:32:54  Show Profile  Visit pascal_jimi's Homepage  Reply with Quote
thank you ver much


http://sql-az.tr.gg/
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 10/10/2013 :  08:23:20  Show Profile  Reply with Quote
is t1 a date? or an integer value giving offset?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
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.07 seconds. Powered By: Snitz Forums 2000