Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Unanswered

LINQ unable to query using ModifiedDateTime field - compile and runtime errors

Posted on by 56

Hello all,

With LINQ in a C# service I am trying to query a AX table and retrieve only the data that was modified after a specific date and time. The compiler is giving a compile error: "Operator '>' cannot be applied to operands of type 'System.ValueType' and 'System.DateTime'.

Here is my code. The cutOffDateTime variable is a DateTime type.

Screenshot-2021_2D00_11_2D00_25-162337.jpg

I have tried converting CreatedDateTime to DateTime but that just removes the VS compiler error and then I get the following error during runtime: The type 'System.DateTime' for the query operator is not Queryable!

The CreatedDateTime property is enabled on the table in question.

Help will be much appreciated.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans