Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Posts
    12

    Unanswered: Days360 function in Access

    Excel has Days360 function that counts days between two dates in 30-day months (needed in accounting etc.)

    My question is how this calculation can be made in Access? I know it can be made with VBA but it's quite a big task and since Excel has the function, is it anyhow possible to convert the function to Access?

    JN

  2. #2
    Join Date
    Apr 2002
    Posts
    139
    Your answer is in this forum's archive.

    Try this:

    Set a reference to Excel 8.0 Object 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)

    Works fine with me, gives access to all Excel functions.

    hth

  3. #3
    Join Date
    Dec 2002
    Posts
    12
    Thanks, it works just fine with me too (Excel 9.0 Object library).

    JN

    Originally posted by marion
    Your answer is in this forum's archive.

    Try this:

    Set a reference to Excel 8.0 Object 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)

    Works fine with me, gives access to all Excel functions.

    hth

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •