Calculating Months Between Dates
Hello,
I am attempting to calculate the months between two dates as precisely as possible.
I don't want to just compare the months themselves, since that would make the consecutive dates of 4/30/18 and 5/1/18 (months 4 and 5) have 1 month passed.
I know this can be done roughly by calculating the days passed and dividing it by the average # of days in a month, but is there a more precise way to do this that compares once that same day (ex. the 10th) is reached or passed on a following month to signify the passing of a month?
Thanks
Comments
-
My suggestion would use the datediff feature then have that be divided by the number of days in the specific month you want to reference. So I would begin with a beastmode to assign each month how many days are in it.
(case when month= 4 then 30
when month =5 then 31
when month = 6 then 30 etc
then you could write a statement like datediff/month from beastmode and it should give you a more precise count on months that passed
I know that this wasnt the most precise answer but maybe it can start some other ideas
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive