SOLVED
subtract two dates and divide by 365.25
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
wonka1234
10 - Fireball
‎06-10-2022
06:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
I am trying to do this formula:
Date 1 - Date 2 / 365.25 OR
maturity date - run date / 365.25 OR
31-Mar-26 - 30-Sep-19 / 365.25
I am expected 6.50 as the answer.
However I am getting 6 when I do this:
DateTimeDiff([ Maturity Date ],[ Run Date ],"years")
Solved! Go to Solution.
Labels:
- Labels:
- Custom Tools
2 REPLIES 2
apathetichell
19 - Altair
‎06-10-2022
07:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
you want to change that from "years" to "days" (or hours) and then do the division... DateTimeDiff gives an integer as an output.
15 - Aurora
‎06-10-2022
07:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@wonka1234 DateTimeDiff() will always return an integer value. Which is calculated as the number of complete periods between the dates. So if you want decimal values, then you need a smaller datepart - e.g. months. You can then divide this number by e.g. 12
