web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Error when delegating ...
Power Apps
Unanswered

Error when delegating Date filter to SQL Server

(0) ShareShare
ReportReport
Posted on by 284

Hi,

 

I am trying to populate a collection with data from an SQL Database. I am delegating a Date filter to the SQL server to minimise the amount of data handled by the PowerApp. When the code is actioned (from a button) I recieve the error "An error occured on the server."

The code attached to the button select property is:

 

 

Set(CurrentDate, DatePicker1.SelectedDate);
Clear(WorkOrderTable);
Collect(WorkOrderTable,Filter('[db_owner].[ResourceEstimationTimeSheet]', Date = CurrentDate))

 

Strangly the filter works fine if i use:

 

Date = DatePicker1.SelectedDate

Instead of:

 

Date = CurrentDate

 

What is the reason for this behaviour?? I have attached an image below for your reference


image.png

Categories:
I have the same question (0)
  • timl Profile Picture
    36,785 Super User 2026 Season 1 on at

    This is an interesting question and I'm curious as to what the answer is.

     

    The thing I notice is that the name of your column in ResourceEstimationTimeSheet is Date. Perhaps Date might be a keyword somewhere in PowerApps, and this might be the cause of the problem? (Date is the name of a function in PowerApps, but I don't think that's the cause of the problem.)

     

    Interestingly, if you fully qualify the field name, the filter expression becomes non delegable and that's not the behaviour I would expect.

     

    DateBug.png

     

    If you were to filter a date column other than the column called 'date', do you get the same behaviour? Incidently, I was able to make this syntax work with my column called 'StartDate' without seeing any error.

  • AnthonyPhan Profile Picture
    284 on at

    Hi @tim

    Thanks for the response. I set up a clone of the ResourceEstimationTimeSheet and renamed the Date column to DateCol. The issue still persists. 

     

    image.png

     

    Its also interesting to note that I am also now able to produce this issue when using DatePicker1.SelectedDate.


    image.png

     

    My DateCol column is of date type Date not DateTime. Could this be the issue?

    EDIT: I also forgot to mention that i have no issue when i filtered on a string type column.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 547

#2
WarrenBelz Profile Picture

WarrenBelz 444 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard