Question Status

Suggested Answer
Ciprian Ioan asked a question on 25 Apr 2013 9:05 AM

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

Reply
Suggested Answer
Joris de Gruyter responded on 25 Apr 2013 9:08 AM

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.

Reply
Ciprian Ioan responded on 25 Apr 2013 9:36 AM

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

Reply
Suggested Answer
Joris de Gruyter responded on 25 Apr 2013 10:43 AM

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

Reply
Ciprian Ioan responded on 26 Apr 2013 12:30 AM

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.

Reply
Suggested Answer
Joris de Gruyter responded on 25 Apr 2013 9:08 AM

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.

Reply
Suggested Answer
Joris de Gruyter responded on 25 Apr 2013 10:43 AM

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

Reply