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

Search on SQL datetime field

Hi,

I'm trying to add a searchbox for a gallery that I can search on a SQL datetime field.  I'm getting a delegation warning.  Search is delagable for SQL and from what I can research, the datetime column type should work as well.  My gallery Items property is:

 

Sort(Search(Filter('[dbo].[ShiftDuty]', Last_Name = PName), SearchBox1.Text, "Date"), Date, Descending)

 

Trying to search on the "Date" field in the ShiftDuty table.  Is it the order of operations for the Sort/Search/Filter functions?


Thanks,
David

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Search on SQL datetime field

Hi @Dpalmer ,

Please notice that:

Operation/Function Number Text Boolean DateTime Guid
Filter Yes Yes Yes No [1] Yes
Sort Yes Yes Yes Yes -
SortByColumns Yes Yes Yes Yes -
Search No Yes No No -
Lookup Yes Yes Yes Yes Yes

DateTime type is non-delegateable in search function.

That's the reason why you met delegation problem.

In all the functions that are used to search, datetime type is delegateable only in lookup function.

So to not have delegation warning, you could use lookup function instead of search function, or change the Date datetime type to text.

You could also consider save data in collection. Collection will not have delegation problem.

What's more, if your record number is smaller than 2000, you do not need to worry about delegation problem.This  will not effect the app's performance.

You just need to change the delegateable limit to 2000.

delegation.jpg

 

Here's a doc about delegateable functions in sql server for your reference:
https://docs.microsoft.com/en-us/connectors/sql/

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: Search on SQL datetime field

Hi @Dpalmer ,

Please notice that:

Operation/Function Number Text Boolean DateTime Guid
Filter Yes Yes Yes No [1] Yes
Sort Yes Yes Yes Yes -
SortByColumns Yes Yes Yes Yes -
Search No Yes No No -
Lookup Yes Yes Yes Yes Yes

DateTime type is non-delegateable in search function.

That's the reason why you met delegation problem.

In all the functions that are used to search, datetime type is delegateable only in lookup function.

So to not have delegation warning, you could use lookup function instead of search function, or change the Date datetime type to text.

You could also consider save data in collection. Collection will not have delegation problem.

What's more, if your record number is smaller than 2000, you do not need to worry about delegation problem.This  will not effect the app's performance.

You just need to change the delegateable limit to 2000.

delegation.jpg

 

Here's a doc about delegateable functions in sql server for your reference:
https://docs.microsoft.com/en-us/connectors/sql/

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,006)