Finding the Difference Between Dates

Use the 'dateDiff()' function to find the difference between two dates in terms of days, months, or years.

dateDiff('d', fromDate, toDate);    // days

dateDiff('m', fromDate, toDate);    // months

dateDiff('yyyy', fromDate, toDate); // years

For example, if a table displays the column 'Birth Date', you can create a formula column to calculate the current age of an individual by subtracting the 'Birth Date' from today's date:

dateDiff('yyyy', field['Birth Date'], CALC.today())

See Also

Creating a Formula Column in Data Binding Wizard, in Report Design, for more on formula columns.

<< 3.5.3 Useful Date Functions © 1996-2013 InetSoft Technology Corporation (v11.5) Calculating a Past or Future Date >>