Date addition and subtraction

  • Last update:  2021-10-26
  • I. Overview

    During data query, it is common to encounter data query corresponding to the specified days before and after a certain date, as shown in the following figure. How to achieve this?

    0.jpg

    II. Implementation idea

    Add and subtract dates by using the DATEDELTA() function.

    III. Example

    1) Opening a template

    2) Report parameter settings

    Add a default value to the original Date parameter. The default value is a string and the value is 2008-01-30.

    Add another parameter named day.

    3) Parameter settings

    Set the parameters screen to the following style:

    1.jpg

    Set the Date widget type to Date and return the default string type.

    The widget type of parameter widget day is a drop-down box. Select the data dictionary from the property table on the upper right. The data dictionary is shown in the following figure:

    2.jpg

    4) Setting filter criteria

    Delete the original filter criteria of A2.

    Add the following two filter conditions to cell A2:

    3.jpg

    5) Saving a template

    Click Pagination Preview, select a date, and then select the query range. The result looks like the image above.

    For the completed template, see: %FR_HOME%\webroot\WEB-INF\reportlets\doc-EN\Parameter\Date_addition_and_subtraction.cpt


    Attachment List


    Theme: Parameter
    Already the First
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy