Start a new topic
Answered

Comparing a date attribute with current date

I have a problem with my grid script. I want to compare a date (@ABCDATE - a part attribute of type Date) with the current date to decide if an item is “in effect” or not.


Best Answer

Thanks for your question. Below is a simple example of this in a Report configuration. 


<Report>

<Text>#{? isEffective(@DDAT, @SA0073 )}</Text>

  <Function name="isEffective" as="Boolean">
    <Parameter name="date1" as="Date"/>
    <Parameter name="date2" as="Date"/>
    <Value select="if $date1 &lt; $date2 then true else false "/>
  </Function>

</Report>



1 Comment

Answer

Thanks for your question. Below is a simple example of this in a Report configuration. 


<Report>

<Text>#{? isEffective(@DDAT, @SA0073 )}</Text>

  <Function name="isEffective" as="Boolean">
    <Parameter name="date1" as="Date"/>
    <Parameter name="date2" as="Date"/>
    <Value select="if $date1 &lt; $date2 then true else false "/>
  </Function>

</Report>




2 people like this
Login to post a comment