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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Error when trying to r...
Power Apps
Answered

Error when trying to retrieve data from the network: We cannot apply operator

(0) ShareShare
ReportReport
Posted on by 14

Hello,

 

I'm creating a carbon emissions data capture app.

Data is stored in SQL - the underlying data looks something like this:

 

"VehicleFuels" table for all data entries relating to distance travelled per each vehicle type, and a "VehicleFuelsReport" table which after a button press will store the sum of all entries in any given column from the VehiceFuels table, and apply a conversion factor and store this value too.

 

In the app, I have two DatePicker controls (FromDatePicker & ToDatePicker).

rNimmo_0-1690884538192.png

 

Upon clicking a "Search" button, the container these are in is set to invisible and an edit form appears.

rNimmo_1-1690885352713.png

 

The datasource for the form is the "VehicleFuelReport" table.

I've not added an "Item" property as Power Apps ignores this if the form's "Default mode" is New, which mine's is.

 

In the form, to calculate the sum for each entry, I have this formula in each DataCardValue label:

 

Sum(Filter(VehicleFuelsReport, LocationID = SelectedLocationID && CreatedDate > FromDatePicker.SelectedDate), CompanyCarPetrolDistance)

 

However, Power Apps is giving me an error saying "Error when trying to retrieve data from the network: We cannot apply operator".

 

Seems completely correct to me? Has to be something else causing the issue.

 

I've Tried:

  • Removing the "CreatedDate" filters and only filtering on LocationID which works, however this is not the value I need.
  • I've removed both datasources from the app completely and re-added them.
  • Changed the data row limit from 500 > 1000 > 2000
  • Closed the app and re-opened.
  • Tried every combination of the formula I can possibly think of.
  • Looked at countless form posts.....

 

Does anyone have any ideas what may be causing this?

 

Thanks,

Categories:
I have the same question (0)
  • Verified answer
    timl Profile Picture
    36,415 Super User 2025 Season 2 on at

    Hi @rNimmo 

    The most likely cause is that the data type of your CreateDate column is 'datetime'.

    The SQL Server connector doesn't support the greater/less than operators against this data type.

    If this is the case, you can resolve this by using a view or by changing the data type of CreateDate to 'datetimeoffset'

     

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Filter-a-gallery-by-date-for-SQL-column-of-type-datetime2/m-p/954505

     

  • rNimmo Profile Picture
    14 on at

    Hi @timl 

     

    You were right, following the link you provided I was able to solve my problem.

     

    Thanks mate!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard