Your technique using the list function to automatically add dates to today's date is terrific. I have a need to do that and to add 24 hours to each date. How can I do that?
Larry
Hi Larry,
With the List.DateTime function:
e.g.
= List.DateTimes(#datetime(2019, 01, 01, 00, 00, 0), 744, #duration(0, 1, 0, 0))
Will give you 1 hour for every day in January 2019 i.e. 31 days x 24 hours = 744 records.
Mynda
How does that fit into this formula?
List.Dates(#date(2018,1,1), Duration.Days(DateTime.Date(DateTime.FixedLocalNow())-#date(2018,1,1)), #duration(1,0,0,0))
does this do the what I want?
= List.DateTimes(#datetime(2018, 01, 01, 00, 00, 0), Duration.Days(DateTime.Date(DateTime.FixedLocalNow())-#date(2018,1,1)), #duration(1, 1, 0, 0))
When I tried this, it looked like it gave me date/time numbers or the am/pm times.
Thanks for the help.
Hi Larry,
I think you want this (see changes in red):
= List.DateTimes(#datetime(2018, 01, 01, 00, 00, 0), Duration.Days(DateTime.Date(DateTime.FixedLocalNow())-#date(2018,1,1))*24, #duration(0, 1, 0, 0))
This will give you 24 records for each date with a 1 hour increment.
Mynda
That gave me 24 rows for each date, but didn't increment the hours. All were 12:00 AM.
I spoke too soon. That did give me what I wanted. Thank you very much. I must remember to get the computer some time to finish calculating changes -:)