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
 General SQL Server Forums
 New to SQL Server Programming
 getdate() - date

Author  Topic 

pascal_jimi
Posting Yak Master

167 Posts

Posted - 2013-10-10 : 07:18:01
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

22864 Posts

Posted - 2013-10-10 : 07:24:00
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

167 Posts

Posted - 2013-10-10 : 07:32:54
thank you ver much


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

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-10-10 : 08:23:20
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
   

- Advertisement -