We help IT Professionals succeed at work.

DAYS360

Dwood9015
Dwood9015 asked
on
I need to replicate the Excel DAYS360 in an Access function
Comment
Watch Question

Commented:
you can use this:

DateDiff ( interval, date1, date2, [firstdayofweek], [firstweekofyear])

Example:
DateDiff ("yyyy", #15/10/1998#, #22/11/2003#)       would return 5
DateDiff ("m", #15/10/2003#, #22/11/2003#)       would return 1
DateDiff ("d", #15/10/2003#, #22/11/2003#)       would return 38
Commented:
also:

Set a reference to Excel 8.0 Object Library, also may work with Excel 9.0 library

Then:

Dim num As Integer
Dim startdate As Date
Dim enddate As Date

startdate = #1/1/00#
enddate = #1/1/31#

num = Excel.WorksheetFunction.Days360(startdate, enddate)

Should works fine and gives access to all Excel functions.

Author

Commented:
that works thanks

Explore More ContentExplore courses, solutions, and other research materials related to this topic.