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 :
Microsoft Dynamics AX (Archived)

Validate timestate

(0) ShareShare
ReportReport
Posted on by

Hi,

I have a table that has Validate TimeState property set to Date.

I want to do a select on all records (not only the current ones) but the query is restricted only to the current records.

Do you have any idea how to avoid this?

Thank you!

Ciprian

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Joris dG Profile Picture
    17,775 on at

    Yes, there are query options to "override" the default checking. I blogged about this quite a while ago, you can find the explanation and examples here:

    daxmusings.codecrib.com/.../valid-time-statedate-effective_05.html

    There is also quite a bit of info on MSDN on the topic.

  • Community Member Profile Picture
    on at

    Hi Joris,

    Thank you for your answer.

    I actually wanted to remove all kind of date ranges in my query.

    So select all records no matter if they have a date in a range or not.

    I don't know if it is possible with the validateTimeState being set.

    Ciprian

  • Suggested answer
    Joris dG Profile Picture
    17,775 on at

    you could use datenull() and dateMax() as the values for the from and to date.

  • Community Member Profile Picture
    on at

    Setting  validTimestate(dateNull(), dateMax()) in the select statement will create a restriction.

    For example:

    select validTimestate(dateNull(), dateMax())  from Table1

    is equivalent to

    select  Table1

    where  FromDate <= dateNull()  <= dateMax() <= ToDate.

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans