Cognos Analytics

Expand all | Collapse all

FIRST_DAY(((CURRENT_DATE) + (-1) YEAR)

  • 1.  FIRST_DAY(((CURRENT_DATE) + (-1) YEAR)

    Posted 12 days ago
    hey,
    can anyone please let me know meaning of following sentence.
    BETWEEN FIRST_DAY(((CURRENT_DATE) + (-1) YEAR)) AND CURRENT_DATE

    ------------------------------
    Priyanka Joshi
    ------------------------------


  • 2.  RE: FIRST_DAY(((CURRENT_DATE) + (-1) YEAR)

    Posted 12 days ago
    It's not a format I'm used to, but looking at it I'd say it's trying to filter the date in your report from one year ago to today.

    ------------------------------
    Chris Turner
    ------------------------------



  • 3.  RE: FIRST_DAY(((CURRENT_DATE) + (-1) YEAR)

    Posted 12 days ago
    I agree with Chris T. The Between command will provide a result(s)/value/qry based on the date ranges specified beyond the command.

    Can you provide more detail as to where this command is being applied or used?  


    Rick Stacy
    Computer Programmer/Analyst
    Telecom Division
    Holyoke Gas & Electric
    99 Suffolk Street
    Holyoke, MA 01040
    T- 413-536-9300 (enter 252 once the greeting begins)
    M- 413-875-5170
    rstacy@hged.com
     





  • 4.  RE: FIRST_DAY(((CURRENT_DATE) + (-1) YEAR)

    Posted 10 days ago
    Edited by Michael Walter 10 days ago
    "FIRST_DAY" is not a Cognos function, but it appears to be a vendor-specific one in IBM DB2 (see, https://www.ibm.com/support/knowledgecenter/SSCRJT_7.0.0/com.ibm.swg.im.bigsql.commsql.doc/doc/r0061474.html). What DB is your function running against?

    In any event, per the above, "BETWEEN FIRST_DAY(((CURRENT_DATE) + (-1) YEAR)) AND CURRENT_DATE" would mean FROM the first day of the current month one year ago TO the current day. For example, as I write this, today is 11/20/2020, so BETWEEN 11/1/2019 AND 11/20/2020 (including the start and end dates).

    ------------------------------
    Michael Walter
    Business Analyst
    TX HHSC
    Austin
    ------------------------------