Full Version: YearFrac Year Fraction Calculation
UtterAccess Forums > Microsoft® Access > Access Date + Time
Benjam75
I have the Microsoft Excel 11.0 Object Library installed as Reference in my Access database. However, I cannot get the YearFrac function to work.
oes anyone know how to make use of the Excel YearFrac function in Access?
I've tried the DateDiff function, but it's programatically arduous to use it in order to replicate the YearFrac results.
Any help would be appreciated. Thanks
BrianS
I believe you must create an Excel Application Object then use the Worksheet function as a method of that Object
im xls as New Excel.Application
Debug.Print xls.YEARFRAC(start_date,end_date,basis)
SerranoG
What about
!--c1-->
CODE
sngYearFrac = CSng(DateDiff("d", dtmStart, dtmEnd)) / 365.25
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.