I want to filter a Sharepoint list to a single item based on a date. The field is a Date without time.
When I use the formula
Filter(OnCallTeam,WeekStart >= DatePicker2.SelectedDate)
... I get multiple results and the blue dot. When I change the formula to equal instead of greater than and equal to ...
Filter(OnCallTeam,WeekStart = DatePicker2.SelectedDate)
... I get an error. "The requested operation is invalid. Server Response: The expression "DateField eq 2017-05-23" is not valid".
How can I filter on a single date only?
This should be caused by the DatePicker control.
The format under SQL Server table date column does not match the date format defined with the DatePicker control, so when conpare them with the equal sign, it will show the error message.
For more information, please check the following thread:
Please take a try with the workaround mentioned by Meneghino, create a calculated integer field for the date column in the table in SQL Server with value yyyymmdd, then use text function to convert the datepicker value, and compare them:
Value(Text(DatePicker1.SelectedDate, "yyyymmdd")) = SQLCalculatedDateIntegerField
Another way is to use text function to convert both date value into string, which then would turn into delegation issue with the formula, that means, only the first 500 records could be filtered.
@v-micsh-msft Have you read my question? I'm not querying SQL. This is a SharePoint data source.
If the >= operator works fine, why should the = operator not work????
Sorry for the misleading. My bad.
SharePoint date column format also doesn't work with the DatePicker control.
Issue is similar to SQL Server, and the workaround should work, add another Text field to hold the calculated date, then compare.
>= means compare with two values, but the "=" would have more restrictions to make the expression work.
As I told above, the Type, format and value all should meet.
While when using ">=", which I think it only compare the value within the same data type, not restricted with the data format.
Sorry, but that approach does not work, either. I wrote the date into a calculated field that has 'yyyymmdd', but I still get an error when I do a comparison with "="
Why is this so hard? How can I get records with a specific date into an app if the underlying SharePoint list has thousands of items? If that is not possible, what are PowerApps good for?
This worked for me.
Filter('OSIT - Incidents', Date_x0020_Logged <= dateSearch.SelectedDate, Date_x0020_Logged >= dateSearch.SelectedDate)
But it won't work with delegation, so it is a temporary fix.
I get the wokraround but I can't get my Calculated Column in my Sharepoint list to work.... I use =TEXT([date column], "DDMMYYYY") but doesn't work...
Check it out!
Check it out!
Fill out a quick form to claim your user group badge now!
Find out where you can attend!
Features releasing from October 2019 through March 2020
The largest Power BI, Power Platform, and Data conference in New Zealand