First day of previous month

Hi,
I created a data parameter and I want my date parameter default value to be the first day of previous month, the expression {$FIRST_DAY_OF_MONTH()$} is pointing to the fitst day of current month and when I tried {$FIRST_DAY_OF_MONTH()-1$} it is just subtracting a day(thought to go back one month)...Is there way I can point my default value to first day of previous month.?
Regards

hmm is BI Publisher in Beta? Are there any workarounds you can suggest me to achieve this?
I see the user stated that a workaround is possible at RTF template level? How can we achieve this?
Re: Default date as first of month
Edited by: user8937215 on Aug 10, 2010 7:30 AM

Similar Messages

  • Printing Last Day of previous month

    I need to print Last day of previous month, and the date value is relative to the system date.
    In my previous post i have got the answer to print last day of current month. To print last date in previous month do i need to use RelativeDate? and I am not sure whether I can use RelativeDate for months.
    Raghu

    Right now I have written below formula, and it works fine in all cases like if the current month equals to 01, 03, 05,07,08,10 and 12 and months other than mentioned in above including 02.
    for First day of previous month
    =If (FormatDate(CurrentDate();"MM"))InList("07";"08";"10";"12";"05";"01";"03") Then
    (If(FormatDate(CurrentDate();"dd"))="01" Then
    FormatDate(LastDayOfMonth(RelativeDate(CurrentDate();-1));"MM")"/01/"FormatNumber(Year(LastDayOfMonth(RelativeDate(CurrentDate();-1)));"####")Else
    FormatDate(LastDayOfMonth(RelativeDate(CurrentDate();-31));"MM")"/01/"FormatNumber(Year(LastDayOfMonth(RelativeDate(CurrentDate();-31)));"####"))Else
    FormatDate(LastDayOfMonth(RelativeDate(CurrentDate();-30));"MM")"/01/"FormatNumber(Year(LastDayOfMonth(RelativeDate(CurrentDate();-30)));"####")
    For Last day of previous month
    =If (FormatDate(CurrentDate();"MM"))InList("07";"08";"10";"12";"05";"03";"01") Then
    (If(FormatDate(CurrentDate();"dd"))="01" Then LastDayOfMonth(RelativeDate(CurrentDate();-1))Else
    LastDayOfMonth(RelativeDate(CurrentDate();-31)))Else LastDayOfMonth(RelativeDate(CurrentDate();-30))
    Please let me know any other suggestions.
    -Raghu

  • How to find first and last day of previous month?.

    Based on current month, I want to find start and end day of
    previous month.
    For example,
    For august, Start date is July 1st and End date July 31st.
    How can i get first of previous month as start date and last
    day of the previous month as end date?.
    Same way,
    i want to find start date of current month and end date of
    next month.
    Example:
    For august,
    i want to get start date, august 1st and end date : september
    30.
    How can i do this from current date or now().
    I am looking for best and easy way to find start and end
    dates..
    Thanks

    <cfset today = now()>
    <cfset firstOfThisMonth = createDate(year(today),
    month(today), 1)>
    <cfset lastOfNextMonth = dateAdd("d", -1, dateAdd("m", 2,
    firstOfThisMonth))>
    <cfoutput>
    today = #today#<br>
    firstOfThisMonth = #firstOfThisMonth#<br>
    lastOfNextMonth = #lastOfNextMonth#<br>
    </cfoutput>
    Edit - To find the start and end day of previous month, get
    the first of THIS month. Use Subtract 1 month ("m") to get the
    start date. Subtract 1 day ("d") to get the end date.

  • Defining last day of previous month in ABAP

    All,
    I am a BW guy and hardly know ABAP. I have a requirement where I have to calculate last day of previous month and use it in the routines of the transformations.
    I have decided to define the Last day of previous month in Start routine and then use the global variable in Transformations to calculate further.
    The logic that i have used is outlined below.
             Define G_DATE in global declaration for further use in Transformations.
    In the Routine section,
            Assign G_DATE to SY-DATUM
            G_DATE + 6(2) = '01' (Replace last to field of date with '01' to establish first day of the current month)
            G_DATE = G_DATAE - 1 (To get to last day of previous month)
    My dilemma is to implement this in ABAP in Start routine of transformations. Please include the exact ABAP code that would be needed in Declarations and Routine section.
    Thanks in advance.

    Hi..,
    Go with the function module: LAST_DAY_OF_MONTHS
    So, Just determine the last month from the sy-datum and then use above function module and pick the last date of the month.
    Thanks,
    Naveen Inuganti.

  • Date Functions( first day of a month that is 3 months from now....)

    I have recently written my first stored procedure.
    Its rather a bunch of SQL statements.
    I had to hard code lot of dates. most of them are first day of the current monthe or last day of current month etc.
    I thot of parametrizing all the dates, but if a business person has to include all the parameters they could go wrong and get the wrong results.
    Now, I want to use date functions to achieve these requirements:
    Can any one please throw some insght into this:....
    1) First day of current month,
    2) last day of current month.
    3) first day of previious month
    4) last day of previous month
    5) first day of a month that is 3 months from now.
    6) last day of a month that is 3 months from now.
    7).....
    Can any one please throw some light on any one of this.. I can try to work from there onwards ....
    Thanks a lot in advance,
    Ac

    Hi there,
    1) First day of current month
    select trunc(sysdate, 'MM') from dual;
    2) last day of current month.
    select trunc(add_months(sysdate, 1), 'MM') - 1 from dual;
    3) first day of previious month
    select trunc(add_months(sysdate, -1), 'MM') from dual;
    4) last day of previous month
    select trunc(sysdate, 'MM') - 1 from dual;
    5) first day of a month that is 3 months from now.
    select trunc(add_months(sysdate, 3), 'MM') from dual;
    6) last day of a month that is 3 months from now.
    select trunc(add_months(sysdate, 4), 'MM') - 1 from dual;cheers,
    Anthony

  • I want the minimum of the horizontal axis to be the first day of the month.

    I have a situation where I want the minimum of the horizontal
    axis(with date time axis) to be the first day of the month. I
    attempt it like so:
    var max:Date = new Date();//current date is our max from
    which we will calculate the min
    var min:Date = new Date(max.fullYear,max.month,1);
    dateTimeAxis.minimum = min;
    However this first date on this axis is the last day of the
    previous month for example 31 August instead of 1 September. Any
    ideas how to fix?

    Nikos, the only thing I can think of (off hand) is that it's
    defaulting to "zero" hour on that date, if you tried:
    var min:Date = new Date(max.fullYear,max.month,1,13);
    Would that make it work? That would set the date to 1pm.
    Have you considered defining the axis with the data you are
    binding to?
    Cheers,
    David

  • Previous month first data and previous month last date

    can any body have query to get previous month first date and previous month last date.
    Ex: First day of the previous week:
    TIMESTAMPADD(SQL_TSI_DAY,-6, (TIMESTAMPADD(SQL_TSI_DAY, DAYOFWEEK(CURRENT_DATE) *-1,CURRENT_DATE)))
    Last day of the previous week:
    TIMESTAMPADD(SQL_TSI_DAY, DAYOFWEEK(CURRENT_DATE) *-1,CURRENT_DATE)
    can anybody have it for first day of the previous month,last day of the previous month?
    Edited by: user12255470 on Apr 7, 2010 3:30 AM

    Hi,
    1st day of previous month :
    TIMESTAMPADD(SQL_TSI_DAY, ( DAYOFMONTH(TIMESTAMPADD(SQL_TSI_MONTH,-1,CURRENT_DATE)) * -1) + 1, TIMESTAMPADD(SQL_TSI_MONTH,-1,CURRENT_DATE))
    last day of previous month :
    TIMESTAMPADD(SQL_TSI_DAY,DAYOFMONTH(TIMESTAMPADD(SQL_TSI_MONTH,-1,CURRENT_DATE)) * -1 , TIMESTAMPADD(SQL_TSI_MONTH, 1, TIMESTAMPADD(SQL_TSI_MONTH,-1,CURRENT_DATE)))
    Please mark Q answered and award points for correct answers !
    Thanks
    Alastair

  • How to create report which includes records of current month and last 7 days of previous month.

    Hi Experts,
    I need to create a report which includes records of current month and last 7 days of previous month.
    I will get records of current month by this formula :- month({PROBSUMMARYM1.OPEN_TIME})=month(currentdate)
    Please tell me how to add the records of last 7 days of previous Month for the same report.
    Thanks in Advance.

    Hi Ajay,
    If you have more than a year data in your database then your formula will return wrong results. ie. If your data consist of 2012,2013,2014 data then below formula will return all 8th month data irrespective of year. So, you need to check year also here
    month({PROBSUMMARYM1.OPEN_TIME})=month(currentdate)  and
    Year({PROBSUMMARYM1.OPEN_TIME})=Year(currentdate)
    Now add Abhilash second statement in OR so, your formula should look like :
    (month({PROBSUMMARYM1.OPEN_TIME})=month(currentdate)  and
    Year({PROBSUMMARYM1.OPEN_TIME})=Year(currentdate))
    OR
    Date({PROBSUMMARYM1.OPEN_TIME}) IN [DateAdd('d',-7,Maximum(LastFullMonth)), Maximum(LastFullMonth)
    -Sastry

  • ABAP for the first day of the month

    Hello BW users,
    I have a scenario which uses an ODS with cumulative key figures with Addition update type. An infocube gets data from ODS by start routine in cube's update rule. I update this ODS first then infocube. All the loads are Full and are loaded daily. This is a snapshot scenario and I load the ods on itself then load from another infocube let's say Cube1. After successful load, I update infocube on itself again then update from the same infocube, Cube1, as in ODS. Infocube load sequence is same as ODS. In the scenario ODS and infocube are wanted to be updated daily. Therefore, I have to delete the ODS's (since it is addition update type) and infocube's overlapping data in the process chain that automates the load. At this point I need two things:
    1- ABAP program that is going to give me the first day of each month.
    2- ABAP program that is going to delete the overlapping data in ODS when I load it daily. Since I can do that for infocube in process chain with standard process type of Delete overlapping requests from infocube I need it only for ODS. Because there is no standard process type to delete overlapping requests in ODS (since its update type is Addition).
    I appreciate your help. Thank you in advance.
    Sincerely,

    1- ABAP program that is going to give me the first day of each month.
    if sy-datun+6(2) = 01.
    SY-FDAYW should give you the day
    endif.
    2- ABAP program that is going to delete the overlapping data in ODS
    REPORT  <PGM NAME>.
    TABLES: RSODSACTREQ , rsseldone.
    Parameters : odsname type RSINFOCUBE default '<>ODS NAME'.
    DATA: temp_REQUEST LIKE RSODSACTREQ-REQUEST,
          temp_REQUEST1 LIKE RSODSACTREQ-REQUEST,
          temp_RNR LIKE rsseldone-RNR.
    DATA: BEGIN OF itab OCCURS 0,
          REQUEST LIKE RSODSACTREQ-REQUEST,
          TIMESTAMP LIKE RSODSACTREQ-TIMESTAMP,
          END OF itab.
    DATA: BEGIN OF itab1 OCCURS 0,
          RNR LIKE rsseldone-RNR,
          seldate LIKE rsseldone-seldate,
          seltime LIKE rsseldone-seltime,
          END OF itab1.
    SELECT REQUEST TIMESTAMP FROM RSODSACTREQ INTO TABLE itab
      WHERE ODSOBJECT = '<ODS NAME>'.
    SORT itab DESCENDING BY TIMESTAMP .
    READ TABLE itab INDEX 1.
    temp_REQUEST = itab-REQUEST.
    SELECT RNR seldate seltime FROM rsseldone INTO TABLE itab1
      WHERE source = '<Info Source Name for the ODS>'.
      SORT itab1 DESCENDING BY seldate seltime .
      READ TABLE itab1 INDEX 1.
      temp_RNR = itab1-RNR.
    *If   temp_REQUEST = temp_RNR .
    CALL FUNCTION 'RSSM_PROCESS_REQUDEL_ODSO'
      EXPORTING
        I_ODS             = odsname
        I_REQUEST         = temp_REQUEST
        I_JOBNAME         = 'i_jobname'
        I_VARIANT         =
        I_INSTANCE        =
      IMPORTING
        E_ERROR           =
        E_T_MSG           = itab1
      E_T_RNRLIST       =    ITAB1.
    *else.
    *raise exception.
    *endif.
    clear itab.
    refresh itab.
    SELECT REQUEST TIMESTAMP FROM RSODSACTREQ INTO TABLE itab
      WHERE ODSOBJECT = '<ODS NAME>'.
    SORT itab DESCENDING BY TIMESTAMP.
    READ TABLE itab INDEX 1.
    temp_REQUEST1 = itab-REQUEST.
    if temp_REQUEST = temp_REQUEST1.
    raise exception .
    endif.

  • Date for first day of current month

    How can i get the date for first day of current month ?

    select trunc(sysdate,'MM'),to_char(trunc(sysdate,'MM'),'DD'),to_char(trunc(sysdate,'MM'),'Day') from dual;

  • Show data of last day of previous month against any day of current month

    Hi,
    I have fact table which contains data at date level (we have data for oct-2009 to april-2010). Our requirement is to show data of last day of previous month against any day of current month in obiee 11g. I am facing problem in Feb 2010 its picking data of 28-Jan-2010 instead of 31-jan-2010 and for April its picking data of 30-mar-2010 instead of 31-mar -2010.
    Any suggestion ???

    You're asking to filter your data set to only include rows between:
    1) last day of the previous month
    2) any day of the current month
    This can be achieved with prompting in OBIEE Answers.
    last day of previous month = TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE)) . The problem is you need to make query work within Oracle's Answer syntax.
    In the prompt, select the operator type for your date dimension as 'between' and default to 'SQL Results'.
    For the 'last day of previous month' , use the query:
    SELECT
    case when 1=0 then Time."Fiscal Date" else TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE))
    end
    FROM ENTER_YOUR_PRESENTATION_FACT_FOLDER_HERE
    For the current date, use the query:
    SELECT
    case when 1=0 then Time."Fiscal Date" else CURRENT_DATE
    end
    FROM ENTER_YOUR_PRESENTATION_FACT_FOLDER_HERE
    Another option is to create a last_date_pervious_month variable in the RPD and have that as the default value in your prompt.

  • How to get the first day in the month from a domain date ?

    Hi,
    I like to know how to get the first day in the month from a domain date?
    Thanks
    Stephen

    Hi Gokul...
    Instead of using the funtion module you can just write the 3 statements of code to get the first day of the week.
    Its similar to the above one but instead of writing case statement you can achive the following.
    data : w_res type i,
             w_data type d,
    w_res = w_date mod 7.
    w_date = w_date - w_res.
    write w_date.
    This works.
    Regards,
    Siddarth

  • A day from previous month

    Hi,
    Is there any function module to get a day from previous month? I tried FM 'CCM_GO_BACK_MONTHS', but it is not working correctly.
    If I give the sy-datum input as '03/30/2007', it is giving the previous month date as '02/30/2007'
    Thanks,
    Uma.

    Try.....
    report zrich_0001 .
    data: day_from_previous type sy-datum.
    call function 'RE_ADD_MONTH_TO_DATE'
      exporting
        months        = '-1'
        olddate       = sy-datum
      IMPORTING
        NEWDATE       =  day_from_previous.
    write:/  day_from_previous.
    Please be sure to award points for helpful answers to all your threads today, and mark as solved when answered completely.  Thanks.
    Regards,
    Rich Heilman

  • Function module to get the 'first day of next month'

    Hi
    I have a selection screen with  input fields
    1. period (month eg: 07)
    2.year(fiscal year eg: 2008 )
    If user enters 07 as month and 2008 as year, then I have to display 08/01/2008(MM/DD/YYYY) as output.
    Requirement is to calculate the  'first day of next month'
    I have written code for this requirement.But I am asked to use function mdule.
    Please help me in this regard.
    Thanks&Regards
    Rama.Mekala

    hi try this FM ...
    HR_JP_MONTH_BEGIN_END_DATE
    it gives the Begin Date and End date of the month
    rewards points if found useful
    regards,
    Balaji

  • How to get the first day of current month

    hi guys,
    i am trying to get the first day of current month which get from the date i input at the selection screen. my method is not so good, so i was wondering if there is better way to get the this,
    thanks.

    Try this .
    data : DAYNR LIKE  HRVSCHED-DAYNR,
         DAYTXT LIKE  HRVSCHED-DAYTXT.
    data langu like sy-langu value 'EN'.
    Parameters PDATE LIKE SY-DATUM.
    PDATE+6(02) = '01'.
    CALL FUNCTION 'RH_GET_DATE_DAYNAME'
      EXPORTING
        LANGU                     = LANGU
        DATE                      = PDATE
      CALID                     =
    IMPORTING
       DAYNR                     = DAYNR
       DAYTXT                    = DAYTXT
      DAYFREE                   =
    EXCEPTIONS
      NO_LANGU                  = 1
      NO_DATE                   = 2
      NO_DAYTXT_FOR_LANGU       = 3
      INVALID_DATE              = 4
      OTHERS                    = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    WRITE :/ PDATE, DAYNR, DAYTXT.
    Cheers

Maybe you are looking for

  • Apache2, MySQL5 and PHP conundrum

    Right now I have a functioning Apache2 server. I got it going awhile ago when I installed the Complete Apache2 binary package by Server Logistics. Comparatively speaking, it was pretty much a no-fuss installation into the ~/Library directory. Now, I

  • Agenda Builder for Bangalore - is it ready?

    Hi all, has anyone been able to access the Agenda Builder yet? I've registered for Bangalore TechEd and the email says this tool will be available in early October. Cheers Stephen

  • How to I make frozen Import warning go away?

    I attempted to open a Word document on Pages and got an import warning.  No problem.  The problem is that I can't make the import warning go away.  The "done" button is not responding and Pages is frozen.  I can't open this or any other document.  Wh

  • W2 Missing in ESS

    For the life of me, I would think the ability to give a user their W2 would be standard delivered in the business package for ESS.  We're using Netweaver 7.0 enhancement pack 1. I cannot find the iview for W2.  Where is it?  Do I need to activate som

  • Instance completed without consuming it's messages

    Hi, I'm new to BizTalk and am having trouble with a simple Orchestration I am trying to build. I'm looking to receive a flat file which could contain multiple orders and am debatching it in the Pipeline.  I then have an Orchestration which receives t