Hi,
I'm trying to get SharePoint list items from the last 3 months from a column called DueDate. I'm trying with this formula in the filter query, but it's not working.. (items are not from last 3 months).
DueDate ge '@{formatDateTime(startOfMonth(getPastTime(3,'Month')),'MM-dd-yyyy')}' and DueDate lt '@{formatDateTime(startOfMonth(utcNow()),'MM-dd-yyyy')}'
Any ideas anyone?
Solved! Go to Solution.
Ah great! Then, the above formula should work for you. I used it in the Filter Query field of my Get Items action - you'd just replace ReviewDate with DueDate. Let me know how it goes.
I answer questions on the forum for 2-3 hours every Thursday!
Hi there,
Just to be super clear: are you looking for the last 90 days, or the last 3 months - and does that "last 3 months" include this month? (This month, last month, the month before, in full?)
I tried out this formula, and it brought back the dates of January 1st to April 1st.
ReviewDate ge '@{startOfMonth(getPastTime(3,'Month'))}' and ReviewDate lt '@{startOfMonth(utcNow())}'
These are the dates on my list - and it only retrieved two of them - so it did it correctly:
Are you able to tell me - if your flow triggered on April 15th, what is the earliest date you would expect to see?
Cheers,
Rhia
I answer questions on the forum for 2-3 hours every Thursday!
Hey, thanks for helping out!
90 days or 3 months, basically it doesn't make a lot of difference, any of the two would be good.
Last 3 months include this month.
Ah great! Then, the above formula should work for you. I used it in the Filter Query field of my Get Items action - you'd just replace ReviewDate with DueDate. Let me know how it goes.
I answer questions on the forum for 2-3 hours every Thursday!
This works 🙂