I get a different results with all three formulas as shown below, but my customer wants Days360 which is not in Access. Anyone know how to get to Days360 result in Access query?
![]()
I get a different results with all three formulas as shown below, but my customer wants Days360 which is not in Access. Anyone know how to get to Days360 result in Access query?
![]()
No formulas nor results shown.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
there are a number of solutions given on this page.
good luck with your project,
Cottonshirt
Followed those calcs and built VBA function. Gives same result as Excel.
Code:Function Days360(dteStart As Date, dteEnd As Date) Days360 = ((Year(dteEnd) - Year(dteStart)) - 1) * 360 + ((12 - Month(dteStart)) * 30) + (30 - Day(dteStart)) + ((Month(dteEnd) - 1) * 30) + (Day(dteEnd)) End Function
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Attached is what I get for the VBA function as well as DateDiff, DatedIf and Days360. You will see that none of these match Days360 100%. Maybe this is the closest I can get? Or, any other ideas?
I ran into a similar issue attempting to translate Excel cell formulas into Access VBA. Calcs involved matrix multiplication. I compared cell formula calcs with running Excel functions in VBA as well as strictly VBA. Got 3 different output.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thank you for you assistance, I will have to let my customer know he has to pick one of the three in access.
how do I get a query to use this function?
Which function?
Put VBA custom function in a general module. Then it can be called in query.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Great, thanks