Note that there are some explanatory texts on larger screens.

plurals
  1. POReport Application Pascal - Variable value not being shown correctly
    text
    copied!<p>I'm building a report using Report Builder. It uses Report Application Pascal, which is based on Delphi Object Pascal. I'm still learning this and struggling with a variable value. </p> <p>I have a variable called 'duration' which contains the following script:</p> <pre><code>value := round(ReportWizardQuery['wodFinishDate'] - ReportWizardQuery ['wodCreateDate']); </code></pre> <p>This gives me the result I want. It calculates the total number of days between the two dates. </p> <p>What I'm trying to do then is to use the value of this 'duration' variable to find out if jobs (which are defined by the start and end date) have been completed on the same day, within 1-5 days, 6-10 days, etc. </p> <p>I've created columns with these headings and placed a varible in each column in the detail band of the report. The code I have written in the variable for 'same-day' is:</p> <pre><code>if (duration = 0) then value := 1; </code></pre> <p>Likewise for jobs being completed between 1 - 5 days</p> <pre><code>if (duration &gt; 0 and &lt; 6) then value := 1; </code></pre> <p>But variables are blank when report run. I have tried to assign the value of the 'duration' variable to that of the same-day variable and it returns a weird number which is the the same for each line in the report (99468080, or 10150660...etc) This number changes each time I run the report and always seems to be 8 digits long. </p> <p>Does anybody have any idea what I'm doing wrong and how I can assign the value 1 for each variable if the duration variable = 0, or between 1 - 5, etc. </p> <p>Thanks. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload