title: Date range in query Dynamics AX
body: <p>I would like to build query Range, where </p>
  
  <p><a href="https://i.stack.imgur.com/4ol6M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4ol6M.png" alt="enter image description here"></a></p>
  
  <p>ActiveTo &lt; today || ActiveFrom > today.</p>
  
  <p>Is it possible, I tried something like that but it's not working.</p>
  
  <pre><code>qbdsDimAttrValue = ds.addDataSource(tableNum(DimensionAttributeValue));
  qbrMainAccountActiveFrom = qbdsDimAttrValue.addRange(fieldnum(DimensionAttributeValue,ActiveFrom));
  qbrMainAccountActiveFrom.value(strFmt('(((%1.%2 != 0) || (%1.%3 != 0)) &amp;&amp; ((%1.%2 &gt; %4) || (%1.%3 &lt; %4)))',   
              qbdsDimAttrValue.name(),
              fieldStr(DimensionAttributeValue,ActiveFrom),
              fieldStr(DimensionAttributeValue,ActiveTo),
              today(),
              ));
  </code></pre>
  
  <p>I write 0, because in table DimensionAttributeValue if field ActiveFrom, ActiveTo is null it has value 0, not dateNull(), dateMax()</p>