cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mh2
Level: Powered On

Select Range between two date

Hi there,

I'm trying to display in a DataTable that takes records from CDS all the rows that have the date field between two dates (chosen by DatePickerStart and DataPickerEnd selection). 

What I can do now is a Filter in which I can select records of one specific date: 

    Filter(checkin; StartsWith(cr5a8_dataoraregistrazione; Text(DatePicker.SelectedDate)));

But how can I extend it in a range of two dates?

Thanks for your help!

1 REPLY 1
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Select Range between two date

You can use the < and > comparison operators (or <= and >=) to check if a field is between two dates, like in the example below. That will work if the field cr5a8_dataoraregistrazione is of type "Date Only" ("Solo data") or "Date and Time" ("Data e ora") in your CDS entity.

Filter(
    checkin;
    cr5a8_dataoraregistrazione >= DatePicker1.SelectedDate;
    cr5a8_dataoraregistrazione <= DatePicker2.SelectedDate)