Need to calculate diff in no of days from two month intervals

Dear Friends,
I have a variable which gets input like from and to months.
I want the difference in number of days between those two months which i need to use it in the report.
eg.Jan 06 to Feb06 --> it has to give me 31+28=59days as my output.
Can anyone please tell me how to do this in BEX.
Also explain me in step be step with abap code required if it is only possible with variable exit.
Thanks in advance
Sudhakar M

hi
use the replacment path to calculate the difference..
folow the link...
http://www.sd-solutions.com/documents/SDS_BW_Replacement%20Path%20Variables.html
praveen.

Similar Messages

  • How to calculate a number of calendar days from a start date (e.g. 60 days from 3/10/2012)

    How to calculate a number of calendar days from a start date (e.g. 60 days from 3/10/2012)

    DT,
    If the starting date is in Column A, and you want to calculate what the date would be 60 days later, in Column B, write in Column B:
    =A+60
    Couldn't be much easier.
    Jerry

  • How do I calculate days from two different dates?

    Hi all,
    How do I calculate days from two different dates?
    my requirement is to pass the number of days to target field from two dates.
    Current date :  14/04/2010
    Standard date: 01/01/1957 is the standard = day 0
    Is it possible in graphical mapping with out  udf?
    Plz help me on this I have donu2019t have much knowledge on JAVA.
    Thanks

    Hi Yadav,
    Probably this is not the correct forum for XI / PI .
    You can post the same to...
    Process Integration (PI) & SOA Middleware
    Hope this helps.
    Regards
    Raj

  • How do I calculate days from two different dates in XI/PI?

    Hi all,
    How do I calculate days from two different dates in XI/PI?
    my requirement is to pass the number of days to target field from two dates.
    Current date : 14/04/2010
    Standard date: 01/01/1957 is the standard = day 0
    Is it possible in graphical mapping with out udf?
    Plz help me on this I have donu2019t have much knowledge on JAVA.
    Thanks

    Hi Yadav,
    Probably this is not the correct forum for XI / PI .
    You can post the same to...
    Process Integration (PI) & SOA Middleware
    Hope this helps.
    Regards
    Raj

  • 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

  • How can I calculate the maximum number of days between two dates in a range of dates?

    I have a column of dates spanning the couse of a few months.  I would like to know if I can calculate the maximum number of days between each row and display the highest number.  I currently have another column that calculates the days betwen the rows and I am currently just looking at the totals and highlighting the highest period.
    Is this possible?  Any help or suggestions are appreciated.
    Thank you,
    Trevor

    This sounds totally possible,  Can you post a screen shot of your table to make responding more focused?  If you mean you want to:
    A) compute the difference (in days) between two date in the same row, then
    B) find the max duration (in days)
    Here is my take on this problem:
    D2 = C2-B2
    select D2 and fill down
    F1=MAX(D)
    to perform the conditional formatting (to highlight the max duration) select column D, then set up conditional formatting as shown in the 1st image

  • Need of SQL query in selecting distinct values from two tables

    hi,
    I need a query for selecting distinct values from two tables with one condition.
    for eg:
    there are two tables a & b.
    in table a there are values like age,sex,name,empno and in table b valuses are such as age,salary,DOJ,empno.
    here what i need is with the help of empno as unique field,i need to select distinct values from two tables (ie) except age.
    can anybody please help me.
    Thanks in advance,
    Ratheesh

    Not sure what you mean either, but perhaps this will start a dialog:
    SELECT DISTINCT a.empno,
                    a.name,
                    a.sex,
                    b.salary,
                    b.doj
    FROM    a,
            b
    WHERE   a.empno = b.empno;Greg

  • Query to exclude just one day from a month/months.

    I'm sorry if a thread about this already exists i tried searching for it but couldnt find it. My question is as follows:
    I want to write a query which would fetch all the data from the month of Jun and July excluding Jun 29th. Is there a way to write a query without a subquery or function? If not then a subquery and a funtion query would work also.
    Thanks for you help.

    SQL> select date '2007-05-31' + level day from dual connect by level <= 61
      2  minus
      3  select date '2007-06-29' from dual
      4  /
    DAY
    01-06-2007 00:00:00
    02-06-2007 00:00:00
    03-06-2007 00:00:00
    04-06-2007 00:00:00
    05-06-2007 00:00:00
    06-06-2007 00:00:00
    07-06-2007 00:00:00
    08-06-2007 00:00:00
    09-06-2007 00:00:00
    10-06-2007 00:00:00
    11-06-2007 00:00:00
    12-06-2007 00:00:00
    13-06-2007 00:00:00
    14-06-2007 00:00:00
    15-06-2007 00:00:00
    16-06-2007 00:00:00
    17-06-2007 00:00:00
    18-06-2007 00:00:00
    19-06-2007 00:00:00
    20-06-2007 00:00:00
    21-06-2007 00:00:00
    22-06-2007 00:00:00
    23-06-2007 00:00:00
    24-06-2007 00:00:00
    25-06-2007 00:00:00
    26-06-2007 00:00:00
    27-06-2007 00:00:00
    28-06-2007 00:00:00
    30-06-2007 00:00:00
    01-07-2007 00:00:00
    02-07-2007 00:00:00
    03-07-2007 00:00:00
    04-07-2007 00:00:00
    05-07-2007 00:00:00
    06-07-2007 00:00:00
    07-07-2007 00:00:00
    08-07-2007 00:00:00
    09-07-2007 00:00:00
    10-07-2007 00:00:00
    11-07-2007 00:00:00
    12-07-2007 00:00:00
    13-07-2007 00:00:00
    14-07-2007 00:00:00
    15-07-2007 00:00:00
    16-07-2007 00:00:00
    17-07-2007 00:00:00
    18-07-2007 00:00:00
    19-07-2007 00:00:00
    20-07-2007 00:00:00
    21-07-2007 00:00:00
    22-07-2007 00:00:00
    23-07-2007 00:00:00
    24-07-2007 00:00:00
    25-07-2007 00:00:00
    26-07-2007 00:00:00
    27-07-2007 00:00:00
    28-07-2007 00:00:00
    29-07-2007 00:00:00
    30-07-2007 00:00:00
    31-07-2007 00:00:00
    60 rijen zijn geselecteerd.Regards,
    Rob.

  • Need help finding accounts that expire 90 days from date created

    Hi, I am trying to find all temp accounts in AD that expire 90 days after the account was created.  Here is what I have so far. I am not sure how to calculate that. I am not receiving any output.
            $expireDate = (Get-ADUser -filter * -Properties accountExpires).accountExpires
        $accountExpireDate = ([System.DateTime]::FromFileTime($expireDate)).AddDays(-90).Date
        Get-ADUser -Filter {whenCreated -ge $accountExpireDate} -Properties whenCreated | select name | export-csv 'c:\temp\all_temp_users.csv'enter code here

    OK. I read your question again and I think I understand what you are asking now.
    Try it this way:
    $DaysSinceCreation = 90
    get-aduser -ldapfilter "(&(!(accountExpires=0))(!(accountExpires=9223372036854775807)))" -properties accountExpires,whenCreated | foreach-object {
    $accountExpires = [DateTime]::FromFileTime($_.accountExpires)
    if ( ($accountExpires - $_.whenCreated).Days -eq $DaysSinceCreation ) {
    new-object PSObject -property @{
    "distinguishedName" = $_.DistinguishedName
    "whenCreated" = $_.whenCreated
    "accountExpires" = $accountExpires
    -- Bill Stewart [Bill_Stewart]
    Here is what i modified for expand the range of $dayssincecreation value. It appears to work but is kind of sloppy. Its not a big deal, but is there a way to make this cleaner? i tried a range variable and did not have any luck. Again thanks for all your
    help!
    $DaysSinceCreation = 85
    $DaysSinceCreation1 = 86
    $DaysSinceCreation2 = 87
    $DaysSinceCreation3 = 88
    $DaysSinceCreation4 = 89
    $DaysSinceCreation5 = 90
    $DaysSinceCreation6 = 91
    $DaysSinceCreation7 = 92
    $DaysSinceCreation8 = 93
    $DaysSinceCreation9 = 94
    $DaysSinceCreation10 = 95
    $DaysSinceCreation11 = 96
    get-aduser -ldapfilter "(&(!(accountExpires=0))(!(accountExpires=9223372036854775807)))" -properties accountExpires,whenCreated | foreach-object {
    $accountExpires = [DateTime]::FromFileTime($_.accountExpires)
    if ( ($accountExpires - $_.whenCreated).Days -eq $DaysSinceCreation -or ($accountExpires - $_.whenCreated).Days -eq $DaysSinceCreation1 -or ($accountExpires - $_.whenCreated).Days -eq $DaysSinceCreation2 -or ($accountExpires - $_.whenCreated).Days -eq $DaysSinceCreation3 -or ($accountExpires - $_.whenCreated).Days -eq $DaysSinceCreation5 -or ($accountExpires - $_.whenCreated).Days -eq $DaysSinceCreation6 -or ($accountExpires - $_.whenCreated).Days -eq $DaysSinceCreation7 -or ($accountExpires - $_.whenCreated).Days -eq $DaysSinceCreation8 -or ($accountExpires - $_.whenCreated).Days -eq $DaysSinceCreation9 -or ($accountExpires - $_.whenCreated).Days -eq $DaysSinceCreation10 -or ($accountExpires - $_.whenCreated).Days -eq $DaysSinceCreation11) {
    new-object PSObject -property @{
    "SamAccountName" = $_.SamAccountName
    "whenCreated" = $_.whenCreated
    "accountExpires" = $accountExpires

  • Number of days in current month

    Hi all,
    I have a reporting situation, where I need to calculate the total
    number of days in the currrent month based on system date/calender date. Do we have a standard function to return this value? Or any
    variable? Or if you have done something similar, please let me know.
    This is what I need. If today is July 28, then I need the value 31 to be returned. If its February, 28 or 29 dependinng on whether its leap year or not. I want to use this value to calculate other values.
    Any help appreciated Guys !!!

    LAST_DAY_IN_PERIOD_GET should get you started..
    Good Luck

  • What do you do in a query in order to find the 1st day of last month ?

    i use a
    select trunc(trunc(sysdate,'mon')-1,'mon') from dual;
    what about you guys ?

    Hi,
    Of all the solutions, I like yours
    add_months(trunc(sysdate,'mm'),-1)or doing the operations in the opposite order, like Sentinel did
    trunc(add_months(sysdate,-1),'mm')best, mainly because:
    (1) it's easy to read and understand
    (2) it's easy to modify (in case you want the first day from three months ago, or six months in the future)
    By the way, after you post something on this forum, if you see that you've made a mistake, you can correct it. Click on the second icon to the left of "Reply". (What is that: a hand holding a pencil?) You don't need to post a second message.

  • How to select a single day from month view

    From my ipad on IOS7 I can not select a single day from the month view? From the old versions all I had to do was double click a single date even if it had multiple appointments in it to view it. Was this feature removed?  Please help

    It appears to me as though it has indeed been removed. You can tap and hold down on a day while in month view to create or view an event, but you cannot tap on the day to open the whole day's events.

  • Last day from the list of dates

    i have a query which give me list of dates. From these list of date i want to find the last day in all months. when i am using last day fucntion i am getting last day from the sysdate and not from the list of dates generated by my query.
    the query
    (select distinct to_date(substr(batch_id,1,6),'DDMMRR') batch_id from gcon_mst_v0)
    order by batch_id desc
    i want last day from each month from the list of dates listed from the query.
    Help would be higly appriciated
    Thanks in advance

    The column is a varchar but i am convering it to get
    the list od dates as you can see in the query. i want
    all the last dates of every month from that list of
    dates for eg. below is the list of the dates i am
    getting from the query.
    7/11/2007
    7/10/2007
    7/9/2007
    7/8/2007
    7/6/2007
    7/5/2007
    7/4/2007
    7/3/2007
    7/2/2007
    7/1/2007
    6/29/2007
    6/28/2007
    6/27/2007
    6/26/2007
    6/25/2007
    6/24/2007
    6/22/2007
    6/21/2007
    6/20/2007
    6/19/2007
    6/18/2007
    6/17/2007
    6/15/2007
    6/14/2007
    6/13/2007
    6/12/2007
    6/11/2007
    6/10/2007
    6/8/2007
    6/7/2007
    6/6/2007
    6/5/2007
    6/4/2007
    6/3/2007
    6/1/2007
    5/31/2007
    5/30/2007
    5/29/2007
    5/28/2007
    5/27/2007
    5/25/2007
    5/24/2007
    5/23/2007
    5/22/2007
    5/21/2007
    5/20/2007
    5/18/2007
    5/17/2007
    5/16/2007
    5/15/2007
    5/14/2007
    5/13/2007
    5/11/2007
    5/10/2007
    5/9/2007
    5/8/2007
    5/7/2007
    5/6/2007
    5/4/2007
    5/3/2007
    5/2/2007
    5/1/2007
    4/30/2007
    4/29/2007
    4/27/2007
    4/26/2007
    4/25/2007
    4/24/2007
    4/23/2007
    4/22/2007
    4/20/2007
    4/19/2007
    4/18/2007
    4/17/2007
    4/16/2007
    4/15/2007
    4/14/2007
    4/12/2007
    4/11/2007
    4/10/2007
    4/9/2007
    4/8/2007
    4/6/2007
    4/5/2007
    4/4/2007
    4/3/2007
    4/2/2007
    4/1/2007
    3/30/2007
    3/29/2007
    3/28/2007
    3/27/2007
    3/26/2007
    i want the last date for all the months listed. that
    would be
    6/29/2007 -- last day for june
    5/31/2007-- last day for may
    4/30/2007-- last day for april
    3/30/2007-- last day for march and so on
    thankswrite query as
    SELECT LAST_DAY(TO_DATE(SUBSTR(COLUMN_NAME,X),'MM/DD/YYYY'))
    FROM TABLE_NAME

  • How to calculate the number of days until your next birthday. Only using current month, day and birth month and day.

    I'm trying to calculate the number of days until your next birthday. Only using current month, day and birth month and day. I can get close but i'm way off. When i enter in the next day, the amount of days is supposed to be 364. This is where I am having problems. I know my code is way off. I just need some guidance please!
    Attachments:
    D5.7_1.vi ‏8 KB

    I just had a little fun with the Time Record...
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    D5.7_1_BD.png ‏19 KB

  • User Exit Formula Variable - to calculate #days of any month

    Hello Team,
    I need a column in my report layout which shows the #days of any month entered by the user. User entry 01.2014 to 03.2014 report should have 31 28 & 31 according to the Calendar month in the rows.
    To achieve this I'm using a user exit formula variable in my local calculation. An Optional Interval User Entry variable on CALMONTH is also put in at the filter section.
    I created a CLASS with 2 methods CONSTRUCTOR( vNam = 'ZC2C_DSONWDAYS') & GET_VALUES. We may also use FM /OSP/GET_DAYS_IN_MONTH but i need the code because I failed terribly.
    GET_VALUES method code:
    if i_step = 2.
       DATA: wa like line of i_t_var_range[].
       DATA: L_V_INDICATOR TYPE SCAL-INDICATOR.
       data: begin of ccrange ,
               iobjnm(30) type c,
                 sign(1),
                  opt(2),
                  low(7) type c,
                 high(7) type c,
             end of ccrange.
      data: l_s_range type rrrangesid,
            no_of_wrkdays type i value 0,
            startdate     type d,
            enddate       type d,
            startmth(2)   type c,
            endmth(2)     type c,
            startyr(4)    type c,
            endyr(4)      type c,
            endday(2)     type c,
            leapyear      type i value 0,
            dayofmth      type syst-datum.
    DATA:  day           type SCAL-INDICATOR.
      loop at i_t_var_range into wa.
        if wa-iobjnm = '0CALMONTH'.
           ccrange-sign = wa-sign.
           ccrange-opt = wa-opt.
           ccrange-low = wa-low.
           ccrange-high = wa-high.
           exit.
        endif.
      endloop.
      startyr  = ccrange-low+0(4).
      startmth = ccrange-low+4(2).
      endyr    = ccrange-high+0(4).
      endmth   = ccrange-high+4(2).
      concatenate startyr startmth '01' into startdate.
    * determine last day of the end month
      if endmth = '02'.
         leapyear = endyr mod 4.
         if leapyear = 0.
            endday = '29'.
         else.
            endday = '28'.
         endif.
      elseif ( endmth = '04' or endmth = '06' or endmth = '09' or endmth = '11' ).
           endday = '30'.
      else.
           endday = '31'.
      endif.
      concatenate endyr endmth endday into enddate.
      dayofmth = startdate.
    IF startmth <= endmth.
       startmth = startmth+1.
    ENDIF.
    * do it for all days in space of time
       WHILE dayofmth <= enddate.     "to date
         CALL FUNCTION '/OSP/GET_DAYS_IN_MONTH'
         EXPORTING
           input = startmth
         IMPORTING
           output = no_of_wrkdays.
           CLEAR l_s_range.
           l_s_range-sign = 'I'.
           l_s_range-opt = 'EQ'.
           l_s_range-low = no_of_wrkdays.
       append l_s_range to e_t_range.
           startmth = startmth + 1.
           CONCATENATE startyr startmth '01' into dayofmth.
        ENDWHILE.
    endif.
    endmethod.

    Hi Vasavi,
    1)  Create a FV to calculate no.of days  like below, with calmonth in ref characteristics :
    2. If you see number of days is an attribute of calmonth. Please enter that as below :
    3. Create a formula with above variable and make sure calmonth is added in the row.
    Its giving output like this :
    I hope this will help you.
    Thanks,

Maybe you are looking for