cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
freddiejoseph1
Helper III
Helper III

Filter Data Table by Date Range

Hi all,

 

I am currently trying to filter a data table by a date range which is manually chosen by the user of the app. They have two date pickers, one is the start of the date range and the second is the end of the date range. I cannot get the second date picker (the one that selects the end of the date range) to work. I think there might be something wrong with the format of the date/time of the date picker but I cannot work out what it is.

 

The data table is filtered like this:

 

Filter(
FinanceTimeLog,
(
(IsBlank(NamePicker_1.Selected.UserPrincipalName) || AgentID = NamePicker_1.Selected.UserPrincipalName)

 

&&

(IsBlank(TeamPicker_1.Selected.Result) || Title = TeamPicker_1.Selected.Result)

 

&&

 

(CategoryPicker_1.Selected.Result = "All" || ok6e = CategoryPicker_1.Selected.Result)

 

&&

 

StartTime >= DatePicker2.SelectedDate

&&

StartTime <= DatePicker2_1.SelectedDate
))

 

You can see from the screenshots that when I change the second date picker to the date of the ticket that was logged, the item does not show in the table. Even though the filter is for: StartTime <= DatePicker2_1.SelectedDate.

 

This part of the formula: StartTime >= DatePicker2.SelectedDate works perfectly.

 

freddiejoseph1_1-1619515355323.png

Above the date of the ticket is 26/04/2021 and both the date filters work perfectly. However, if I change the End Date datepicker (datepicker2_1) to 26/04/2021, the item does not show up:

freddiejoseph1_2-1619515466814.png

 

Any help would be much appreciated.

 

Thanks,

 

Freddie

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User III
Super User III

Hi @freddiejoseph1 

I think the problem is that the target record that you want to display has a date of '26/04/2021 08:55' (notice the time component).

Most likely, your end date criteria has a time component of 00:00, which would explain why you don't see your expected record in the result.

If you want to show all records that were created on the 26/04/2021 up to 23:59, an easy option would be to modify your logic to test for an end date of < 27/04/2021.

&& StartTime < DateAdd(DatePicker2_1.SelectedDate,1)


You may need to add the 1 day in a With block or variable if your formula shows a delegation warning with this technique.

View solution in original post

2 REPLIES 2
timl
Super User III
Super User III

Hi @freddiejoseph1 

I think the problem is that the target record that you want to display has a date of '26/04/2021 08:55' (notice the time component).

Most likely, your end date criteria has a time component of 00:00, which would explain why you don't see your expected record in the result.

If you want to show all records that were created on the 26/04/2021 up to 23:59, an easy option would be to modify your logic to test for an end date of < 27/04/2021.

&& StartTime < DateAdd(DatePicker2_1.SelectedDate,1)


You may need to add the 1 day in a With block or variable if your formula shows a delegation warning with this technique.

View solution in original post

That works. Thanks a lot 🙂 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (30,763)