Function to get the last day of the current month

Hi friends
Now I need to know a function to get the last day of a month. I had between my notes that function but I do not find it and I think you can give the answer faster.
Thanks
Joel Pérez
DBA Oracle

I know emoticons are a bit naff but in the absence of a UBB markup to indicate humourous intent they do serve to indicate a joke. This is useful in a purely verbal domain like these forums, especially given that many participants don't have English as their first lanaguage and so often miss the wordplay.
Cheers, APC

Similar Messages

  • Is there any predefined functions to get the current month info?

    Hi,
    I have a business rule which is used to calculate the budget of current month. Right now, I set the current month as a variable, which will need to be changed every month, I know it's stupid, I am new to this area, so I am thinking is there any better way to do this?
    Any inputs is appreciated.
    Thanks
    Tony

    Using substitution variables for current month is perfectly acceptable and widely used.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to get the current month number

    Hi everyone,
    Does anybody know how to get the current month number in Oracle Discoverer Worksheet calculation?
    I try to use EUL_DATE_TRUNC(CURRENT_DATE, 'MM'), but instead I got 01-AUG-00.
    If I change the data display format to MM, it will give me "08" but if I use TO_NUMBER function to convert it to number I get error "invalid number"
    Is there anyway to get the current month value in number? Thanks

    Scott,
    Thank you so much! It works perfectly! :)
    Hope you have a great day ahead!
    Cheers,
    Angeline

  • How to Get the current month at timezone UTC-10

    Hi All,
       can you please let me know How to Get the current month at timezone UTC-10.
    Function module ? which date and time needs to pass.

    Hi,
    Try with following code.
    DATA zdate TYPE  D.
    DATA ztime TYPE  T.
                      CALL FUNCTION 'ISU_DATE_TIME_CONVERT_TIMEZONE'
                        EXPORTING
                          x_date_utc          = sy-datum
                          x_time_utc          = sy-uzeit
                          x_timezone          = 'UTC-10'
                       IMPORTING
                         Y_DATE_LCL          = zdate
                         Y_TIME_LCL          = ztime
                       EXCEPTIONS
                         GENERAL_FAULT       = 1
                         OTHERS              = 2.
                      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 : zdate, / ztime.
    Thank you,
    Sekhar.

  • How to get the current month value for a customer exit variable?

    How to get the current month value for a customer exit variable? 
    And also if we have an InfoObject with date value (including date, month, year), then how to derive the month value from this date type of Char.?
    Thanks!

    Hi Kevin,
    Check here........
    Re: Customer Exist for "From Current Date To Month End"
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/25d98cf6-0d01-0010-0e9b-edcd4597335a
    Cal month
    Regards,
    Vijay.

  • Help:Unable to get the Current Month Data

    Hello Folks,
    Hello Folks i have this scenario where i need to modify this code so that it has to return data from the Current month First Day to the previous Day if its a daily report and previous month data if its a monthly report.
    BEGIN
    if v_lowdate is null or v_highdate is null then
    select to_number(to_char(sysdate, 'DD')) into v_cur_day from dual;
    if v_cur_day < 25 then
    -- this is for the previous month run
    Select Add_Months(trunc(sysdate, 'MONTH'), -1)
    INTO V_LOWDATE
    FROM DUAL;
    SELECT Last_Day(ADD_Months(Sysdate, -1)) INTO V_Highdate From Dual;
    else
    -- this is for the current month run
    Select trunc(sysdate, 'MONTH') INTO V_LOWDATE FROM DUAL;
    SELECT Last_Day(Sysdate) INTO V_Highdate From Dual;
    end if;
    end if;
    I have replaced the above code with the code below but its still returning the previous month Data. Any help would be appreciated.
    v_lob := get_admin_value(p_admin_procedure_name => 'CLIENT_DATAFEED_CODE',p_err_msg => v_error_text);
    if v_lowdate is null or v_highdate is null then
    v_cur_day := TO_CHAR (SYSDATE, 'DD');
    IF report_type = 'D' -- Daily report
    AND v_cur_day > '01' -- (except when run on 1st of the month)
    THEN -- will cover from
    v_lowdate := TRUNC (SYSDATE, 'MONTH'); -- 1st of this month to
    v_highdate := TRUNC (SYSDATE - 1); -- yesterday
    ELSIF report_type = 'M' -- Monthly report
    OR ( report_type = 'D' -- (or Daily report
    AND v_cur_day = '01' -- if run on the 1st of the month)
    ) -- will cover from
    THEN
    v_lowdate := ADD_MONTHS ( TRUNC (SYSDATE, 'MONTH')
    , -1
    ); -- 1st of last month
    v_highdate := TRUNC (SYSDATE, 'MONTH') - 1; -- last day of last month
    END IF;
    END IF:

    How are you testing this? It works for me, or at least generates the dates I think you want.
    SQL> var fake VARCHAR2(25);
    SQL> var report_type VARCHAR2(1);
    SQL> exec :fake := '16-oct-2009'; :report_type := 'M';
    PL/SQL procedure successfully completed.
    SQL> DECLARE
      2     v_cur_day  VARCHAR2(2);
      3     v_lowdate  DATE;
      4     v_highdate DATE;
      5     fake_date  DATE := TO_DATE(:fake, 'dd-mon-yyyy');
      6  BEGIN
      7     v_cur_day := TO_CHAR (fake_date, 'DD');
      8     IF :report_type = 'D' AND v_cur_day > '01' THEN
      9        v_lowdate := TRUNC (fake_date, 'MONTH'); -- 1st of this month to
    10        v_highdate := TRUNC (fake_date - 1); -- yesterday
    11     ELSIF :report_type = 'M' OR (:report_type = 'D' AND v_cur_day = '01') THEN
    12        v_lowdate := ADD_MONTHS ( TRUNC (fake_date, 'MONTH'), -1); -- 1st of last month
    13        v_highdate := TRUNC (fake_date, 'MONTH') - 1; -- last day of last month
    14     END IF;
    15     DBMS_OUTPUT.Put_Line('Low: '||TO_CHAR(v_lowdate, 'dd-mon-yyyy'));
    16     DBMS_OUTPUT.Put_Line('High: '||TO_CHAR(v_highdate, 'dd-mon-yyyy'));
    17  END;
    18  /
    Low: 01-sep-2009
    High: 30-sep-2009
    PL/SQL procedure successfully completed.
    SQL> exec :report_type := 'D';
    PL/SQL procedure successfully completed.
    SQL> /
    Low: 01-oct-2009
    High: 15-oct-2009
    PL/SQL procedure successfully completed.
    SQL> exec :fake := '01-oct-2009';
    PL/SQL procedure successfully completed.
    SQL> /
    Low: 01-sep-2009
    High: 30-sep-2009
    PL/SQL procedure successfully completed.John

  • How to get the current month for a variable based on info object 0FISCPER3

    Hie Gurus
    I am working on the financial reports i am failing to derive the Current month from the variable based on infobject 0FISCPER3 PERIOD .
    I would also like to get the same month from the prevoius year. Any ideas?

    If I understood correctly, you need in your repot
    Current Month Plan This year || YTD Plan This Year || Current Month Plan Last Year || YTD Plan Last Year
    Your variable 0I_FISCPER3 must be on the object 0FISCPER3 which is nothing but just the Fiscal Period. This variable is a user entry mandatory Interval variable.
    if you are entering a range in the input screen for this variable, you will get cumulative values. If you just need to get the value for a month in first column your report, you will have to create another variable of type Customer Exit which will read the "To value" entered for the variable 0I_FISCPER3 and columns for Current Month should be restricted on this variable.
    if you are entering a single value in the selection screen of this variable, current month column should be restricted on this variable with "Equal To" operation and YTD colmns should be restricted to "Less Than Equal to" operator with this variable.
    0FISCPER3 just have posting period and not year, so you will have to use varialbes for 0FISCYEAR separately.
    Please let us know if it helps or if you are using some other variable based on 0FISCPER3 or 0FISCPER.
    Regards,
    Gaurav

  • How to get the current month starting date and ending date by default ?

    Hello Creators,
    This is my requirement, kindly do the needful, Please dont gimme any links i've no access for other sites, gimme the right solution.
    My Requirement :
    Creation Date (VBAK-ERDAT) - Select Option. By default, the program should run for the current Month ie between the starting and ending date of the current month when the program is run. Today the date is 18th using sy-datum we can bring the current date by calling it in the initialization event, but the requirement is it should not give me the current date, it should only give me the month starting date and the end date. Kindly help.
    Thanks in advance ...

    DATA: gv_datum LIKE vbak-erdat.
    SELECT-OPTIONS: so_date FOR gv_datum.
    INITIALIZATION.
      CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
        EXPORTING
          iv_date             = sy-datum
        IMPORTING
          ev_month_begin_date = so_date-low
          ev_month_end_date   = so_date-high.
      so_date-option = 'BT'.
      APPEND so_date.
    START-OF-SELECTION.
    Hope this solves the issue. Don't forget to be generous
    Cheers,
    Sougata.

  • What is function I get the current subform?

    Hi.
    Is there some function that return with the name of the subform current?
    I tryed to find on the Help of LiveCycle, but I didn't find. I find out just currentPage, but it returns just the position of the page.
    Thanks

    No problem Rafael,
    The script "this.parent.name" has the following components:
    this = refers to the object that the script is in.
    parent = refers to the container that the object is inside
    name = the name of the specified object, in this case the container that the object is in.
    Now you can extend this up the hierarchy until you get to the container that you want the name of. You can do this by adding more "parent" to the script, the number of parents will depend on how far up the hierarchy you need to go. This should get you closer:
    this.parent.parent.name;
    Good luck,
    Niall
    Assure Dynamics

  • To get the Current Application ID

    Hello,
    Is there any standard function to get the current application id ?
    Thanks
    Geetha

    If the form is built using template.fmb, that should be automatically taken care of I will be surprised if that is not). If that is not the case and if you launching the form using either custom.pll or personalization, can you read the form function where it is called from (most probably in the parameters) and get its application from fnd_form_functions.
    Thanks
    Nagamohan

  • How to get the currrent month and year from a new date object

    If I create a new Date object as "d",
    java.util.Date d = new java.util.Date();how can I format the date to get the current Month as 'Jan' and the current year as '2008'. So if I have something like d.getMonth() gets the current month as 'Oct' and d.getYear() gets '2008'
    Thanks,
    Zub

    [Read the flamin' manual you must. Hmm.|http://en.wikipedia.org/wiki/RTFM]
    ~~ Yoda.
    Well no actually, he didn't say that, but he should have.
    Cheers. Keith.
    PS: Don't say that to a 7 foot pissedOff wookie when he's got his head stuck in a smoking hyperdrive, and you're being chased by a S-class battle cruiser... Ask Yoda how he got to be so short.
    PPS: It is the SimpleDateFormat you seek ;-)
    Edited by: corlettk on 14/10/2008 22:37 ~~ Also far to slow... but funny.

  • Salary in the current month and  the previous one

    Hi
    I have a table that stores payroll details like the following stracture
    earn code
    period from
    period to
    user_id
    time
    I want to do one report which displays both the salary of one employee in the current month and his salary is the previous one
    Thank you for your help

    you might use the LAG-function to get the previous months salary. Hard to know, as you did not provide any information about your report and database versions.

  • Is there any function to get the name of the days?

    Hi,
    I'm using oracle 10.2.0.1.0
    Is there any function to get the days of the week?
    like i need to get sunday,monday,tuesday.....saturday.
    I know i can use union and select the name from dual one by one.
    But just want to know whether there is any other way.
    I need to show the 7 days in a poplist in my form, thats the requirement
    Thanks

    David_Aldridge wrote:
    BluShadow wrote:
    Note: you may want to include "fm" in the format mask, otherwise the name of the day is padded with spaces:
    SQL> ed
    Wrote file afiedt.buf
    1  select replace(to_char(dt,'Day'),' ','*') as fmt1
    2        ,length(to_char(dt,'Day')) as length_fmt1
    3        ,replace(to_char(dt,'fmDay'),' ','*') as fmt2
    4        ,length(to_char(dt,'fmDay')) as length_fmt2
    5  from (select TRUNC(SYSDATE ,'DAY')+Level-1 dt
    6        from   dual
    7        connect by Level<8
    8*      )
    SQL> /
    FMT1      LENGTH_FMT1 FMT2      LENGTH_FMT2
    Monday***           9 Monday              6
    Tuesday**           9 Tuesday             7
    Wednesday           9 Wednesday           9
    Thursday*           9 Thursday            8
    Friday***           9 Friday              6
    Saturday*           9 Saturday            8
    Sunday***           9 Sunday              6
    7 rows selected.
    SQL>
    I think you should use a pl/sql function for this.
    Nah ... just joking.
    I'd be tempted to just use a union all statement to return the seven literals. People will look at it and know exactly what it does.Yeah, agreed, I was just demonstrating that the format mask of a to_char(..., 'Day') pads with spaces, which seems to have been missed in the above answers. ;)

  • Is there a function to get the IP of this remote system

    Hello EveryBody
    Currently I have an application that runs on our network. When someone logs on to the network it checks there system and gets the pc name. I would like to also get the IP address of that system. As well I may later like to ping that computer.
    1) Is there a function to get the IP of this remote system?
    2) IS the a function to ping a remote system and receive back the response?
    Thanks a lot.
    R

    Hello EveryBody
    Currently I have an application that runs on our
    network. When someone logs on to the network it
    checks there system and gets the pc name. I would
    like to also get the IP address of that system. As
    well I may later like to ping that computer.
    1) Is there a function to get the IP of this remote system?
    2) IS the a function to ping a remote system and
    receive back the response?Is this lan only?
    Because if wan or internet then the remote computer would have to have an address that is reachable from your computer. For the internet this would mean it would have to be public. And for a wan the IP would have to be unique across the wan.

  • How to get the current function name in java

    How to get the current function name in java.
    In c it is done as
    printf("%s",__func__);
    Thanx in advance.

    j0o wrote:
    System.out.println("Class Name: " + new Exception().getStackTrace()[0].getClassName() +
    "/n Method Name : " + new Exception().getStackTrace()[0].getMethodName() +
    "/n Line number : " + new Exception().getStackTrace()[0].getLineNumber());
    I pointed the OP at this approach yesterday in one of his multi-posts. I still have not been given my Dukes!

Maybe you are looking for

  • Windows runs, but no display

    When I switch from Mac OS 10.5.6 to Windows XP Pro, Windows starts up, but there is no display. I know Windows is running because it responds to keyboard commands with appropriate Windows noises. This began when I tried to switch to Windows without e

  • Percentage Field like in MS Excel [SOLVED]

    Hi I have a NUMBER(15,3) field in which users can enter percentages. If a user enters 20 (%), the customer wants 0.2 to be stored in the DB, like in MS Excel. As far as I know there is no such data type for fields, is it? Is there a simple solution f

  • Attempting to upgrade Switch IOS with Cisco Works 2.06

    I am running RME version 4.05 and am trying to test pushing IOS images on a 3560 48port PS switch running 128mb ram and 16mb flash. When I run an analysis on Cisco works it states I only have 127mb of ram and 15 mb of flash. Is this a known bug in Ci

  • Extracting compressed files of 2byte filename?

    Sometimes I get zip files containing files 2byte letter-name archived from windows systems. Most of the time, Tiger's unzip feature cannot show the extracted file name correctly. They are shown in numbers like this, "\270\360\300\307\260\355\273\347"

  • Partition size for Leopard

    I am in the process of planning a new internal hard drive for my iMac G5 and am hoping for some advice. It will be a dual boot Tiger/Leopard partitioned 1TB drive (already purchased). I would like to maximize space in my third partition for non-sensi