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

Similar Messages

  • Find number of days in current month

    Hi Folks ,
    I needed some help in knowing the number of days in any month ... I need to develop an application which will be triggering a mail with an excel attachment at the end of every month ...after populating the excel sheet from an Oracle database ..
    Kindly help...
    Thx..

    Thx a lot for your immediate reply .. I tried using
    the calender class. But for my application .. i need
    to automate this process by sending a mail every last
    day of the month... but i am finding it a bit
    difficult to really automate setting the current
    month to the Timer class
    Timer timer;
         public Reminder ( int seconds ) { 
              timer = new Timer ( ) ;
    timer.schedule( new RemindTask ( ), seconds*1000
    000 ) ;
         }The Calendar class is still the best solution IMHO.

  • How to get total number of days in current Fiscal period/year

    Hi,
    I need to get total number of days in current Fiscal period/year (current month) and assign it to an infoobject. I need a routine for this. Is there any function module to get this.If possible pls paste the ABAP code also for this task. Thanks in advance

    here is the FM:
    LAST_DAY_IN_PERIOD_GET
    KJ!!!

  • 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

  • Report for current day and current month

    Hi gurus,
    i 've a report, where i 've to display the values for qty and cost of the material for the current day and current month
    HOw can i do this in BEx Query designer..If any document plz share
    thanks
    rakesh

    hi Kolli
    here i want to filter the data on system date,
    i wnt the report to pick the date dynamically based on the system date.
    but i think restricting on calmonth and calday is not going to solve my scenario..
    rakesh

  • Current day and no of days in current month

    Hi all,
    can anbody tell me which object is used for current day and no of days in current month.

    Hi,
    USe /OSP/GET_DAYS_IN_MONTH Function Module, just give Date you will get No. Of days in that Month.
    Use SY-DATUM for current date.
    Ex:
    Data: dt type SY-DATUM.
    dt = SY-DATUM.
    so you get current date in dt.
    Thanks
    Reddy

  • 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;

  • First day of current month, one year ago

    All,
    Does anyone have a calculation or know how I can calculate the first day of the current month, one year ago? I am trying to setup a filter criteria to show all records created >= 1st day of current month for prior year and <= the last day of the prior month. I have the second half of the equation for last day prior month but need some help on the first half.
    Thanks in advance for any pointers!
    D

    You can try:
    SELECT TRUNC(ADD_MONTHS(sysdate, -12), 'MON') FROM dual;
    Or
    SELECT TRUNC(sysdate-NUMTOYMINTERVAL(1,'YEAR'), 'MON') 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.

  • SSAS Tabular - return number of days in given month using month's start date?

    Is there a way to return the number of days in a month by providing just the month date or month start date?
    We have a time table, but it is at monthly (not daily) granularity.
    So I can't just count rows between start/end of month.
    I need to be able to divide by the number of days in a given month and can't seem to find a way to get number of days in that given month.
    Thanks!

    Hi,
    According to your description, you want to get the number of days in a month with the month's start date, right?
    In this case, we can get the first day of next month using DateAdd function, and then use DateDiff function to calculate the number of days in this month. Here is a sample query for your reference.
    WITH
    MEMBER Measures.Today AS vba!Now()
    member measures.FirstDayOfNextMonth as dateadd("m",1,Measures.Today)
    member measures.daysnumber as datediff("d",Measures.Today,measures.FirstDayOfNextMonth)
    select Measures.daysnumber on 0
    from
    [Adventure Works]
    Reference
    http://msdn.microsoft.com/en-us/library/hh510163.aspx
    http://office.microsoft.com/client/helppreview14.aspx?AssetId=HV080007558&lcid=1033&NS=EXCEL%2EDEV&Version=14&tl=2&pid=CH080007543
    http://office.microsoft.com/client/helppreview14.aspx?AssetId=HV080007559&lcid=1033&NS=EXCEL%2EDEV&Version=14&tl=2&pid=CH080007543
    Regards,
    Charlie Liao
    TechNet Community Support

  • Number of days in a month - 0CALDAY

    Hi,
    I have a query where I am calculating the average daily sales for each month. For this I need to know the number of days in each month. How can I do this? For instance, it should give 31 for Jan, 28/29 for Feb, 31 for Mar and so on. I am using OCALMONTH as the input variable.
    Thanks for your help.
    Uday

    Hi Uday,
    I have a few modifications in the code
    Data: xdate type d,
          ip_year(4) type N,
          ip_month(2) type N.
    Types : Begin of ty_month_days,
           month(2) type N,
           days(2) type N,
           End of ty_month_days.
    Data : it_month_days type ty_month_days occurs 0 with header line.
    ip_year = 2006.
    ip_month = 01.
    do 12 times.
        CONCATENATE ip_year ip_month '01' INTO xdate.
        xdate = xdate + 33.       "this date is in the next month
        xdate+6(2) = '01'.        "first day of next month
        xdate = xdate - 1.        "last day of xmonth
        it_month_days-month = xdate+4(2).       "number of days of xmonth.
        it_month_days-days = xdate+6(2).
        append it_month_days.
        ip_month = ip_month + 1.
    enddo.
    This code stores Month and No. of days in the internal table it_month_days.
    You can access this internal table for your calculations
    This should help.
    Regards,
    Praveen.
    Message was edited by: praveen mathew

  • How To Split One Record  into 30 Records(Number of days in a Month)

    Hi Experts,
      we are getting the montly(yearmonth) Forecast data from flat file we need to generate the report which shows the daily Forecast data,
    For example for the month of June Forecast we have  150EA.
    Flat file data is like this
      0calday    Qty
      201006     150
    we need to show the report like datawise
       Calday                                     Forecast qty
    20100601                                          5
    20100602                                          5
    20100603                                          5
    20100604                                          5
    20100605                                          5
    20100606                                          5
    20100630                                           5
    its like month forecast / Number of days in a month.
    we can achive these  in two ways as per my knowledge
    1. At the time loading data
    2. Reporting level
    Which is the best way
    how can we achive this.
    Thanks
    Chandra

    Hey.  There was a similar posting I gave a suggestion on a while back.  Here is the link...
    Re: Spliting records into cube
    As far as the correct time of doing this, I would definitely do this at the time of data load and not time of reporting. 
    Hope you find it helpful.
    Thanks

  • Calculated item divided by number of days in a month

    Hello.
    I'm trying to create a calculated item, that is supposed to represent a column member, divided by the number of days in a month that's selected from the dashboard prompt.
    I know that I need an SQL function to get the number of days, but I don't think that you can use SQL functions when creating calculated items.
    Is there a way to do this?

    Looks like you are thinking too much
    Use expression builder in the rpd and then just use available functions without 2nd thought.
    if helps mark

  • Calculate the number of days in a month

    I need to do a calculation in my query based upon the number of days in the month. The report is broken down by cal year / month.
    Is there an easy way of identifying these values in the query?
    Regards.

    Hi,
      This can be done by writing an user exit code to determine the number of days in the month.
    Sample Code :
    <
    CHECK i_step = 2.
      READ TABLE i_t_var_range WITH KEY vnam = 'XXXX'
                               INTO loc_var_range.
      IF sy-subrc EQ 0.
        beg_date(6) = loc_var_range-low(6).
        end_date(6) = loc_var_range-low(6).
        beg_date+6(2) = '01'.
        end_date+6(2) = '01'.
        ADD 1 TO end_date+4(2).
        IF end_date+4(2) = '13'.
          end_date+4(2) = '01'.
          ADD 1 TO end_date(4).
        ENDIF.
        no_days = end_date - beg_date.
        l_s_range-sign = 'I'.
        l_s_range-opt  = 'EQ'.
        l_s_range-low  = no_days.
        APPEND l_s_range TO e_t_range.
      ENDIF.
    >
    Hope this helps..
    Thanks & Regards,
    Pradeep

  • I want to get number of days in the month I've chosen from Timeline slicer.

    I want to get number of days in the month
    I've chosen from Timeline slicer,
    does anyone know how to do?
    The problem I want to solve is to divide
    the number of customer visits as a salesman
    made during a month by the number of
    days in the month.

    Excel 2013 Pro Plus with PowerPivot.
    Count working days per month
    considering weekends and holidays.
    With help from book:
    "Building Data Models with PowerPivot"
    by Alberto Ferrari and Marco Russo.
    Easy. Not.
    http://www.mediafire.com/view/rw78t1y3bg8vm0c/04_10_15.xlsx

Maybe you are looking for

  • Can I copy one bus powered USB2 1T HD to another (also via bus power)?

    Hello OK to copy one bus powered USB 2.0, 1T HD to another, also via bus power, or might there be some power issues to be concerned about? Using late 2011 MBP, both Lacie 1T drives are usb 3 but step down to usb 2 on my MBP (or one can go in the thun

  • InDesign CC keeps crashing when I try to save out a printable PDF with Trim and/or Bleed marks.

    Hello! Everytime I try to save out a PDF (Printable, not Interactive) and tick trim or bleed marks, Indesign just crashes. I've uninstalled InDesign and Acrobat. Made sure I had no Preferences saved from CS6, then installed again, but the same keeps

  • What is AS2 for Event.REMOVED_FROM_STAGE (AS3)?

    Hi, I am used to AS3 and am translating back to AS2.  I want to check if something has been removed from the stage.  In AS3, I used this: obj.addEventListener(Event.REMOVED_FROM_STAGE, objRemovedFromStageHandler); How can I do this in AS2? I have bee

  • Old itunes only works for my computer??

    So I have tried to download the new itunes but I always get an error to reinstall it and it never opens. Quictime as well says that apple application support needs to be installed but it is installed. I downloaded the old itunes 8.1 and it opened on

  • Sorting a node and table

    can any one tell, How to sort a dynamically generated table and dynamically generated node?