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 2005 Forums
 Transact-SQL (2005)
 Number of years calc

Author  Topic 

duhaas
Constraint Violating Yak Guru

310 Posts

Posted - 2008-10-02 : 15:33:06
I have the following:

Currentdate	mty_years	maturity
2008-10-02 12.323290 2021-02-01


I want to learn and understand a way to derive the mty_years number using sql by looking @ the currentime and figuring how the mty_years number

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-10-02 : 15:39:03
See http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=78730



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-10-02 : 15:40:19
Or maybe the mty_years is based on a 360-day year as it often is with financial calculations?

SELECT DATEDIFF(DAY, currentdate, maturity) / 360.0E0



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2008-10-02 : 17:29:23
What is the definition of "mty_years"?

CODO ERGO SUM
Go to Top of Page
   

- Advertisement -