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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

select query not returning results properly

(0) ShareShare
ReportReport
Posted on by 504

Hello all,

i am finding strange behavior in below select query.

 

select workerResidentTaxRegion where workerResidentTaxRegion.Worker == worker.RecId
            && workerResidentTaxRegion.ValidTo == dateMax() && workerResidentTaxRegion.ValidFrom == mkDate(2,1,2019);

when i write this query with giving valid to and valid from data it is returning result but when i don't pass the date values it is not returning the result even though the i am passing worker recID, what is the reason for this and what is solution in this type of scenario as i don't to pass the date values. 

P.S the table name is PayrollWorkerResidentTaxRegion and i am also facing similar behavior in other tables too. 

Thanks 

I have the same question (0)
  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: select query not returning results properly

    When you query date effective tables the syntax for select statements is different. If you don't give any date range it will return only records that are valid today (instead of in the past or in the future). You must pass date values. If you don't wish to limit the result with date, you should pass minDate() and dateMax(). Also you should use "validTimeState" keyword in the query.

    Check this whitepaper: docs.microsoft.com/.../date-effective-patterns-white-paper

  • xain Profile Picture
    504 on at
    RE: select query not returning results properly

    thank you, that does help

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,028

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 878 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 579 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans