Inserting DAYS360 formula

  • Thread starter Thread starter Deepak
  • Start date Start date
D

Deepak

hi

I have three field
lastdate
activedate
count

I have a field "average" which i require to calculate the number of days:
e.g.

average = days360 (lastdate, activedate, false)

how can i use this formula and that the result should be stored in the
"average" field.

kindly help

Reg
Deepak
 
Days360 is an Excel function, not an Access one. You can set a reference to
Excel and use it by wrapping it up as an Access function something like
this:

Function XL360(Arg1, Arg2) As Double
Dim objXL As New Excel.Application
XL360= objXL.WorksheetFunction.Days360(Arg1,Arg2)
Set objXL = Nothing
End Sub

Now you can use it like this:

XL360("1/1/2004", "12/31/2004")

which should return 360
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top