Basic Ask :  Search First Day of month two months ago

Hi
How can I to find first day ('01) of two months ago ?

SQL> select last_day(add_months(sysdate,-3)) + 1 from dual;
LAST_DAY(AD
01-FEB-2007Message was edited by:
Eric H
Jens has a better solution. Ignore mine.

Similar Messages

  • How  to  get the FIRST DAY OF THE CURRENT MONTH

    how to get the FIRST DAY OF THE CURRENT MONTH in oracle 9i.
    plzzzzz send immedaily.advance thanks

    TEST@test SQL> select trunc(sysdate,'MON') from dual;
    TRUNC(SYS
    01-OCT-06
    TEST@test SQL>                                  

  • What do I do. I just turned my iPod touch 5 on for the first time in about two  months and it telling me that it is disabled for 23,079,134 minutes please help

    What do I do. I just turned my iPod touch 5 on for the first time in about two  months and it telling me that it is disabled for 23,079,134 minutes please help anything would be good I also have not backed it up for a while now

    Disabled
    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                         
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: How to back up     
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store        
    If you previously synced to the computer then you may be able to recovery use of the iPod without erasing the iPod by following the instructions here:
    Disabled Recovery-must use syncing computer.

  • Why multi day events are shown only on the first day in calendar (in month view)

    Why multi day events are shown only on the first day in calendar (in month view)?

    Figured it out - the event has to be marked as full day event in order to be shown in monthly calendar. Disregard my question.

  • BI Content Variable on 0Calday for first day of the fiscal year and first day of the current month

    Hi Friends,
    In one of my BEx queries, I need to restrict a key figure for 0Calday based on the first day of the current fiscal year. And another key figure for the first day of the current month. Instead of using Customer exit, I hope there is some SAP delivered standard variable for these filters.
    Please let me know if there is anything available for this. Your answers will be highly appreciated.
    Thanks & Regards,
    Ranjan

    Hi Ranjan,
    Please find below standard variables.
    Pls check below link for more.
    Standard Variables in BEX related to Time Charcteristics
    Characteristic
    Variable
    Description
    0CALDAY
    0CWD
    Current Workday (SAP Exit)
    0CALDAY
    0CYTCD
    Cumulated to Current Day (SAP Exit)
    0CALDAY
    0DAT
    Current Calendar Day (SAP Exit)
    0CALDAY
    0DAY_***
    Cumulation of all Values to Key Date (SAP-Exit)
    0CALDAY
    0LYTCLD
    Cumulated to Current Day of Previous Year
    0CALDAY
    0LYTCLD
    Previous Year Cumulated to Current Day (SAP Exit)
    0CALDAY
    0L_DATE
    Last Calendar Date
    0CALDAY
    0P_LY_R
    Comparative Period for Last Year
    0CALDAY
    0P_TY_R
    Period for Current Year up to Yesterday
    0CALDAY
    0S_KDATE
    Key Date Interval for Previous Year (SAP Exit)
    0CALDAY
    0S_KDAY
    Key Date Interval Current Year (SAP Exit)
    Best,
    SATYA.

  • Regarding the first day of the previous month

    hi experts,
                  suppose the date is '010406' what i want that is der any function module so that i can get the first date of the previous month i.e '010306' plz let me know......or sud i add logic for that if yes plz help me........

    better to use own logic for your requirement....
    suppose you have date field
    data : date1 like sy-datum,
    mon(2) type n,
    year(4),
             prev like sy-datum.
    date1 = '20070720'.
    mon = date1+4(2).
    year = date1+0(4).
    if mon ne '01'.
    mon = mon - 1.
    concatenate year mon '01' into prev.
    else.
    mon = '12'.
    year = year - 1.
    concatenate year mon '01' into prev.
    endif.
    write : / prev.
    if the date is like your format i.e. 010406 then
    data : date1(6) value '010406',
    mon(2) type n,
    year(4),
             prev like sy-datum.
    date1 = '20070720'.
    mon = date1+2(2).
    year = date1+4(2).
    if mon ne '01'.
    mon = mon - 1.
    concatenate year mon '01' into prev.
    else.
    mon = '12'.
    year = year - 1.
    concatenate year mon '01' into prev.
    endif.
    write : / prev.
    regards
    shiba dutta

  • My Mac just got real slow opening any webpage? My first problem, I purchased two years ago.

    I purchased my MacBook Air 13" 23 months ago and it has been awesome! My first Mac. I loaded OS X Yosemite 10.10.1 about two weeks ago without problem. I've been experiencing very slow internet downloads. I've checked all my settings and line speeds, it takes 30 to 45 seconds to bring up a page, before it was 3 to 5 seconds.  Help!

    If you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then you can try going to https://appleid.apple.com/ and click 'Manage your Apple ID' on the right-hand side of that page and log into your account. Then click on 'Password and Security' on the left-hand side of that page and on the right-hand side you might see an option to send security question reset info to your rescue email address.
    If you don't have a rescue email address then see if the instructions on this user tip helps : https://discussions.apple.com/docs/DOC-4551

  • "morse code" iCal - first day of month not showing

    on the first square of the calendar (whether it's the first day of the current month or the last day of the previous month) the event titles will not show up - all that shows are dots and dashes and, in some months, solid lines. When you click on one of these events, the event details do show up on the pull-out event details sidebar. This is funky, any way to fix it?

    kduballstar,
    Very often display anomalies can be rectified by refreshing your iCal plist file. This can be accomplished by quitting iCal and dragging the com.apple.iCal.plist file which is located in your Macintosh HD/Users/yourusername/Library/Preferences Folder to the Desktop. Then log out/in or restart and check iCal for normal behavior. You can delete the iCal plist file on your Desktop.
    Let us know what happens.
    ;~)

  • 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

  • Last day of previous month, first day of current month

    Hi,
    Whats the best way to calculate the last date of the previous month, and the first day of the current month.
    Thank you for your help.
    Sumit.

    Here are FMs
    SG_PS_GET_LAST_DAY_OF_MONTH    FM calculating the last day of a month                                                                               
    FVOZ                                                                               
    RE_LAST_DAY_OF_MONTH                                                                               
    HRHCP00_TIME_HANDLING                                                                               
    HR_HCP_GET_LAST_DAY_OF_MONTH                                                                               
    HRVE_REPORTING                                                                               
    HRVE_LAST_DAY_OF_MONTH                                                                               
    RPDD                           HR-D: Payroll Germany                                              
    RP_LAST_DAY_OF_MONTHS          HR-D: Determine last day of month                                                                               
    SLS0                           PAW - Miscelaneous (MISC)                                          
    SLS_MISC_GET_LAST_DAY_OF_MONTH FM calculating the last day of a month                                                                               
    VVSRCH                                                                               
    LAST_DAY_OF_MONTHS                                                                               
    BWSO_DATE_GET_FIRST_WEEKDAY     
    CKSO                            
    CK_F_GET_FIRST_DAY_OF_DATE      
    HRBEN00SPENDA                   
    HR_BEN_SPENDA_FIRST_LAST_DAY    
    HRPB                            
    HRPP_CCODE_GET_FIRSTDAY_PERIOD  
    HRVE_PAYROLL                    
    HRVE_GET_FIRST_LAST_MONDAY      
    JBT6                            
    ISB_GET_FIRST_DAY               
    KED2                            
    RKE_GET_FIRST_DAY_IN_PERIOD     
    MCP2                            
    MC_PERIOTAB_BT_FIRST_LASTDAY    
    MC_PERIO_GET_FIRST_AND_LASTDAY  
    Thanks
    SK

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

  • For the previous month first day and last day

    i want to schedule my reports from the last month first date to last month last date.
    any body have queries for the while scheduling to uuse it.
    Ex:sysdate() - today's date
    first_day_of_month()- first day of current month
    first day of last month ---?
    last day of the last month ---?

    In the parameter, put this
    {$FIRST_DAY_OF_MONTH()$}other values you can use in default parameter values are
    {$SYSDATE()$} - to get current date
    {$FIRST_DAY_OF_MONTH()$} - to get first day of the current month
    {$FIRST_DAY_OF_YEAR()$} - to get first day of the current year
    {$LAST_DAY_OF_MONTH()$} - to get last day of the current month
    {$LAST_DAY_OF_YEAR()$} - to get last day of the current year
    Re: Default date as first of month
    TO get last day of last month
    {$FIRST_DAY_OF_MONTH()-1$}You can add/subtract number with these functions and no other functions are available.

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

  • First Day of Current Month

    I need to return the first day of the current month. I have read I can use:
    WITH  MEMBER [Measures].[FirstDayOfMonth] AS 
    DateSerial(Year(Now()), Month(Now()), 1)
    However, this returns an incorrect format. Can this date member be formatted to yyyy-MM-dd?
    I have also read I can use OpeningPeriod but I could not get this to work.
    My date Hierarchy is:
    [Date].[Year Month Day].[Month]
    And my month members are in the yyy-MM-dd format, for example:
    [Date].[Year Month Day].[Month].&[2015-02-01]

    Thanks Richard,
    I am not sure what the "aa" string is for?
    Yes, I can get the current date using:
    WITH
    MEMBER [Measures].[Month Day] AS
    FORMAT(Now(), "yyyy-MM-dd")
    But I need to return the first date of the current month dynamically. For example, today this value would be: 
    [Date].[Year Month Day].[Month].&[2015-02-01]
    So I cannot use Parent or FirstChild as the hierarchy will not recognise the
    FORMAT(Now(), "yyyy-MM-dd") as a month member as it returns 2015-02-18.
    I believe I need to extract the current month day value, subtract this value from the Now() and add 1 (start of month), for example:
    StrToMember("[Date].[Year Month Day].[Month ].&[" + FORMAT(Now()-[Month Day]+1,
    "yyyy-MM-dd") +"]")
    Which will be 2015-02-18 - 18 + 1 = 2015-02-01
    Or:
    WITH
    MEMBER [Measures].[Month Day] AS
    FORMAT(Now()-[Month Day Value]+1, "yyyy-MM-dd")
    SET [FirstOfMonth] AS
    StrToMember("[Date].[Year Month Day].[Month].&[" + [Measures].[Month Day] +"]")
    So I need a new member to return the month day value.
    Does this make sense? Is there a better way to do this?

  • First day of next month

    Hi,
    My requirement is to display the first day of next month when a month and year are selected in the dashboard prompt. .
    I have 2 prompts, one for Month and the other for Year.
    For example if an user selects 2012 for Year and 09(September) for Month, my column in the report should display 10/1/2012
    Please help in getting this logic working.
    I am using OBIEE 10.1.3

    Use min(date), this always return first day of selected Year,month
    Then add a month to this date.
    Or else get the date of the month and use at DATE
    TIMESTAMPADD(SQL_TSI_MONTH, 1, TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( DATE) * -(1) + 1, DATE))
    Pls mark as correct/helpful if helps
    Appreciate if you update your other post with helpful/correct
    Edited by: veeravalli on Oct 2, 2012 11:53 AM

Maybe you are looking for