Validate timestate

This question has suggested answer(s)

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

All Replies
  • 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.

  • 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

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

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