cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Littlecatt
Frequent Visitor

How to Search - Filter DatepickerFrom and DatepickerTo (getting a String)

Filter(
Travel,
(TravelDate >= DatePicker1.SelectedDate) && (TravelDate <= DatePicker1_1.SelectedDate)
)
_____________________________________________________________________________________________________
TravelDate = String
From Code above Show the Error  of  TravelDate = Invalid argument type. Expecting a Number value.
I have a data table that reads data from a sharepoint data source and the list is called "Travel", The column that i'm wanting to filter by is called "Travel Date". I am wanting to be able to Search Travel Date by Select Datepicker one called "DatePickerFrom" and the other called "DatePickerTo". I would then like the data in the table to just show any items as On selected date (DatePickerTo , DatePickerFrom).

1 ACCEPTED SOLUTION

Accepted Solutions
rubin_boer
Super User
Super User

hi @Littlecatt you will have to convert the string to a date for e.g. Date(2021,2,18) 

base on your date format in the table you can use a combination of text functions to strip the year, month and day from it. for e.g. "01/01/2021", Year will be Right("01/01/2021",4), Month will be Mid("01/01/2021",1,2) and Day will be Mid("01/01/2021",4,2)

 

hope this helps

ps why not keep the date field as date in SharePoint? 

 

View solution in original post

2 REPLIES 2
rubin_boer
Super User
Super User

hi @Littlecatt you will have to convert the string to a date for e.g. Date(2021,2,18) 

base on your date format in the table you can use a combination of text functions to strip the year, month and day from it. for e.g. "01/01/2021", Year will be Right("01/01/2021",4), Month will be Mid("01/01/2021",1,2) and Day will be Mid("01/01/2021",4,2)

 

hope this helps

ps why not keep the date field as date in SharePoint? 

 

View solution in original post

Thank you 

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

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

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,253)