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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

API: Format error in $filter of agedAccountPayables by agedAsOfDate

(1) ShareShare
ReportReport
Posted on by 13
Hi,
 
I'm getting a strange error trying to $filter `agedAccountsPayables` (or Receivables) by `agedAsOfDate` as it always tells me the format of the date is wrong.  The exact same format of $filter works for e.g. `purchaseOrders` by `orderDate`.
 
Is this a bug in the API, or something I am misunderstanding?
 
Examples using the Cronus sample database (with some manual word-wrapping for clarity:
 
GET https:/api.businesscentral.dynamics.com/v2.0/{{tenant}}/production/api/v2.0/agedAccountsPayables?company=CRONUS UK Ltd.&$filter=agedAsOfDate ge 2024-02-01
{
  /error/: {
    /code/: /Application_EvaluateException/,
    /message/: /The format of the Date '>=02/01/24' does not match your device's date settings.//r///r/Make sure that the day, month, and year are in the correct order and use the correct separator (such as - or /). Alternatively, you can always use the format 'yyyy-mm-dd'.  CorrelationId:  b750524a-573b-475f-bdbf-6c85024937be./
  }
}
 
GET https:/api.businesscentral.dynamics.com/v2.0/{{tenant}}/production/api/v2.0/purchaseOrders?company=CRONUS UK Ltd.&$filter=orderDate gt 2024-04-08
{
  /@odata.context/: https:/api.businesscentral.dynamics.com/v2.0/070927bf-7189-4b3c-99b5-60f306d9b138/production/api/v2.0/$metadata#purchaseOrders/,
  /value/: [...results...]
}
 
 
You can see that I am indeed sending in yyyy-mm-dd format that it says you can always use, but the error suggests it has internally been converted to US format dates (and my tenant is a UK one).
 
Very strange that it works for purchaseOrders, but not for agedAccountsPayables.
 
Any suggestions would be much appreciated!
 
 
 
I have the same question (0)
  • Verified answer
    RT-01051226-0 Profile Picture
    13 on at
    Worked out my mistake - agedAsOfDate should of course use an `eq` not `gt`.  The error message made no sense, but the error was using the wrong operator in the $filter.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,132

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 675 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 665 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans