Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
alisag
New Member

Odata Query with Date filters to fetch data from D365FO

Hello All,

I have the following query which is trying to fetch excahnge rates from Exchange Rate Table,

 

 

https://sandbox.operations.dynamics.com/data/ExchangeRates?$select=FromCurrency,ToCurrency,StartDate... FromCurrency eq 'USD' 

is it possible to filter data at the fetch time to get data only for last 2 days(StartDate)

Something like StartDate ge Date.ToText(Date.AddDays(Date.From(DateTime.FixedLocalNow()), -2), "yyyy-MM-dd")

 the above filter didn't worked.

2 REPLIES 2
Expiscornovus
Resolver III
Resolver III

Hi @alisag,

 

Just to double check, you have tried appending the below $filter query parameter directly after the existing url, correct?

 

Can you share the full url you tried?

 

&$filter=StartDate ge Date.ToText(Date.AddDays(Date.From(DateTime.FixedLocalNow()), -2), "yyyy-MM-dd")

lbendlin
Super User
Super User

This documentation is pretty exhaustive and it includes the syntax for relative dates.

 

Documentation · OData - the Best Way to REST

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.