2 Replies Latest reply: Mar 2, 2013 5:39 PM by DNK RSS

    how to date stamp a column

    user9255588
      Hi,

      We have a table , where data loads every month end, and the column is month_end_calendar_dt,

      In my report, I need to date stamp that column . when the report is run in march it should show feb-28-2013, when the report is run in april it should show mar-31-2013. How to achieve this, Please help!!

      Thanks
      SR
        • 1. Re: how to date stamp a column
          Srini VEERAVALLI
          In criteria column properties->Data format look for the available format options

          If helps mark

          Any updates on this

          Edited by: Srini VEERAVALLI on Mar 4, 2013 8:35 PM
          • 2. Re: how to date stamp a column
            DNK
            Hi

            You use the following formula in the fx to show when the report runs for the current month it will show the previous month's last day.

            CASE WHEN CURRENT_DATE BETWEEN TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE) AND TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_MONTH , 1, TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE))) THEN TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE)) ELSE NULL END

            Let me know if u have any issues.

            Thanks
            NK