IBM Business Analytics

 View Only
Expand all | Collapse all

how to covert SQL SERVER script into IBM Cognos Analytics report

  • 1.  how to covert SQL SERVER script into IBM Cognos Analytics report

    Posted Tue April 18, 2023 12:12 PM

    I am designing one report in IBM Cognos Analytics.  the request is to convert the following SQL script into Cognos report to calculate week difference between 2 datetime. please help . thanks in advance.

    -----------------SQL SERVER script statement--------------------------------
    datediff(wk, FIRST_DATE_TIME_STAMP, LAST_DATE_TIME_STAMP)




    ------------------------------
    Rodger Yang
    ------------------------------


  • 2.  RE: how to covert SQL SERVER script into IBM Cognos Analytics report

    Posted Wed April 19, 2023 03:23 AM

    Hi Rodger,

    You might want to create a calculation with the following syntax:
    datediff({ww};[Date1];[Date2]).

    If this datediff function does not work, you might want to calculate using _days_between:
    _days_between ([Date2];[Date1]), you will need to divide by 7 to get weeks instead of days.

    Best regards,



    ------------------------------
    Patrick Neveu
    Positive Thinking Company
    IBM Champion
    ------------------------------