OData empty/0D date filter

Ies_MeulmeesterIes_Meulmeester Member Posts: 3
edited 2021-10-26 in NAV Three Tier
We have a challenge with OData V4 webservices.

We have exposed the Sales Price table (7002) as webservice through a custom page object. For example we want to show all the Sales Price records where Starting Date is empty/0D.

l48pbf8fwkk4.png

I have tried several ways to filter on empty dates in the OData filter but or the webservice return no records or all records.

$filter=Starting_Date eq null – return all records, don't take into account the Starting_Date filter
$filter=Starting_Date eq 'null' – return an error because incompatible types (Edm.Date, Edm.String)
$filter=Starting_Date eq '' – return an error because incompatible types (Edm.Date, Edm.String)
$filter=Starting_Date eq 0001-01-01, in the output empty / 0D displayed as 0001-01-01 but you can't filter on this value
$filter=Starting_Date eq 1753-01-01, SQL min date return no results
Etc..

Hopefully there is any solution for this or has anyone experience with it!

Answers

  • bbrownbbrown MAMember Posts: 3,170
    have you tried using '1753-01-01 00:00:00.000' ? It is a datetime field.

    There are no bugs - only undocumented features.
  • Ies_MeulmeesterIes_Meulmeester Member Posts: 3
    Yes I have tried, but but unfortunately that doesn't work.
Sign In or Register to comment.