SQL Server Forums
Profile | Register | 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
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pascal_jimi
Posting Yak Master

Azerbaijan
150 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
22755 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
150 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
52317 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  
 New 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.11 seconds. Powered By: Snitz Forums 2000