OData empty/0D date filter

Ies_Meulmeester
Member Posts: 3
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.

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!
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.

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!
0
Answers
-
have you tried using '1753-01-01 00:00:00.000' ? It is a datetime field.
There are no bugs - only undocumented features.0 -
Yes I have tried, but but unfortunately that doesn't work.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions