cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
morall
Microsoft
Microsoft

comparing dates

I have a field on in a collection that is a time stamp:

 

Created On = 8/26/2020 9:23PM

 

Then I have two date picker that is just the date:

Start: 8/19/2020
Finish: 8/26/2020

 

In my collection, I have a filter:

 

Filter(
'Pipeline Candidates',
PipelineTemplate.Name = drpPipeline.Selected.Result
, 'Created On' <= pickerStartDate.SelectedDate
, 'Created On' >= pickerEndDate.SelectedDate

 

However, its not returning the appropriate dates. If my EndDate is 8/26, it will only show me results through 8/25. It will not include any results with the date 8/26

 

I suspect its because of the time "9:23 PM". 

 

How do I convert 8/26/2020 9:23PM to 8/26/2020 and keep it as a date type? 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User III
Super User III

Hi @morall ,

That is because created is a date/time value and the date picker is a date, which defaults to the start of the day.

Filter(
   'Pipeline Candidates',
   PipelineTemplate.Name = drpPipeline.Selected.Result &&
   'Created On' <= pickerStartDate.SelectedDate &&
   DateDiff(
      'Created On',
      pickerEndDate.SelectedDate,
      Days
   )<=1
)
  

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

1 REPLY 1
WarrenBelz
Super User III
Super User III

Hi @morall ,

That is because created is a date/time value and the date picker is a date, which defaults to the start of the day.

Filter(
   'Pipeline Candidates',
   PipelineTemplate.Name = drpPipeline.Selected.Result &&
   'Created On' <= pickerStartDate.SelectedDate &&
   DateDiff(
      'Created On',
      pickerEndDate.SelectedDate,
      Days
   )<=1
)
  

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,296)