LAST Date of Last Quarter

Hi Experts,
How to get last date of last quarter from SYSDATE
Thanks
V

SQL> select trunc(sysdate,'q')-1 from dual;
TRUNC(SYS
31-MAR-11Max

Similar Messages

  • How can we see Last Date and last quantities in Bex Analyzer ?

    Hı BW Gurus,
    I have a query that shows consumption quantities for a material regarding to a date interval. On initial screen i specify a material and a date interval ( 01.04.2007 - 15.04.2007 for example). Then query brings total consumptions(261 and 601 movement types) for materials. I set up the query according to stock cube.
    But my client wants the last consumptions (last 601 and last 261) quantities and dates in a different columns. When we include calendar day it can be seen easily all the lines day by day. But we dont want to include calendar day. Thus for one material only one row will be exist. Report template will be like that:
    On initial screen we defined april 2007 , Output:
    Material         Total consump. quantity     Last Consump. Quant.   Last.Cons.Date
    XYZ                         457                                 76                        18.04.2007  
    PS: 76 is included in 457.
    How can we achieve this result?
    Thank you all indeed
    Evren Temiz
    Message was edited by:
            Evren Temiz

    Hi Evren,
    What do you mean?
    Regards.

  • Show records corresponding to last date of last 3 months

    Experts,
    I have a list of records in my logical table like this. All I need to do is create an analysis that will show the records corresponding to last date of the last 3 months. Assuming current month is July. The report must show only the highlighted records. I'm using OBIEE11g
    customer     product     region     Date
    AAA     123     US     7/28/2012
    AAA     234     US     7/31/2012
    AAA     112     US     7/31/2012
    BBB     232     CN     6/21/2012
    BBB     232     CN     6/30/2012
    CCC     132     IN     6/30/2012
    DDD     322     IN     5/31/2012
    AAA     234     US     4/30/2012
    AAA     222     US     4/29/2012
    BBB     112     CN     3/31/2012
    BBB     111     CN     3/22/2012
    Thanks for your help in advance

    You have to create appropriate filters for your analysis.
    1. Create filter on a Day column.
    Choose "is between".
    The cursor have to be in a edit box under first "Value".
    Press "Add" button and choose "SQL Expression". So the "Value" must to change into "SQL Expression".
    Enter the next formula
    TIMESTAMPADD(SQL_TSI_DAY,1-DAYOFMONTH(TIMESTAMPADD(SQL_TSI_MONTH, -2, CURRENT_DATE)),TIMESTAMPADD(SQL_TSI_MONTH, -2, CURRENT_DATE)) Move cursor into next "Value". Press "Add" button and choose "SQL Expression". Enter the CURRENT_DATE into it and press "Ok".
    2. Add another filter on a Day column for example
    "Calendar"."Day" is equal to / is in <current day>
    Then edit filter. Press an icon at right of this filter and chhose "Edit Formula Column...".
    Enter the next formula
    MONTH(TIMESTAMPADD(SQL_TSI_DAY,1,"Calendar"."Day")) - MONTH("Calendar"."Day")Press "Ok".
    Then edit filter once again. Press an icon at right of this filter and chhose "Edit Filter...".
    In a "Value" edit box write "1" and press "Ok".
    Run analysis and you'll get your requirements.

  • Last date of the selected quarter

    hi all - I have been struggling to figure out how to get the last date of selected quarter. for example, if the user has selected 2014 Q1 from the date hierarchy, I want to show 2014-03-31.
    any idea how to accomplish this? thanks in advance

    Hi Sam,
    There are several ways to do this in MDX.  
    One way is to use LastChild a few times.  For example, if your hierarchy had Period, Week, and Day below Quarter, and you were sure the user had selected a Quarter (the MDX could check) try this assuming your date hierarchy is calle [Date].[Fiscal
    Calendar].    [Date].[Fiscal Calendar].lastchild.lastchild.lastchild
      The first lastchild will get the last Period in the Quarter, the second lastchild the last week in that Period and the third lastchild will get the last day of that week.
    Another way, which will work for any level they selected would be something like; assuming the Day level is called [TheDate].   Tail(Descendants([Date].[Fiscal Calendar],[Date].[Fiscal Calendar].[TheDate]),1).item(0)  The descendants
    gets all the days in the selected period, the tail gets a set including just the last day, and Item(0) gets that particular day.
    Of course, the MDX snippets above could be used in larger MDX expressions.
    Hope that helps.  It really is worthwhile to learn a little MDX.  Remember, anything is possible in MDX if the cube has the data.
    Richard

  • How to get first and last date of previous month

    To set default values in selection screen,I want first and last date of the previous month.
    Also I want the first and last dates of previous quarter.
    The quarters can be only january to march, apr to june, jul to sept, oct to dec.
    I want to run a program on beginning of each month by job scheduling having <b>selection screens</b> for the above monthly and quarterly dates.

    Hi Suhas,
    Use the below code.
    DATA: v_date LIKE sy-datum.
    DATA: v_month_begin_date TYPE sy-datum,
          v_month_end_date TYPE sy-datum,
          v_month(2) TYPE n,
          v_month1(2) TYPE n,
          v_quarter TYPE i,
          v_year(4) TYPE n,
          v_quarter_begda TYPE sy-datum,
          v_quarter_endda TYPE sy-datum.
    v_month =  sy-datum+4(2).
    IF v_month = '01'.
      v_month = '12'.
      v_year = sy-datum+0(4) - 1.
    ELSE.
      v_month = v_month - 1.
      v_year = sy-datum+0(4).
    ENDIF.
    CONCATENATE v_year v_month  '01' INTO v_date.
    CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
      EXPORTING
        iv_date             = v_date
      IMPORTING
        ev_month_begin_date = v_month_begin_date
        ev_month_end_date   = v_month_end_date.
    v_month1 = sy-datum+4(2).
    IF v_month1 = '01' OR
       v_month1 = '02' OR
       v_month1 = '03'.
      v_quarter = 1.
    ELSEIF v_month1 = '04' OR
           v_month1 = '05' OR
           v_month1 = '06'.
      v_quarter = 2.
    ELSEIF v_month1 = '07' OR
           v_month1 = '08' OR
           v_month1 = '09'.
      v_quarter = 3.
    ELSEIF v_month1 = '10' OR
           v_month1 = '11' OR
           v_month1 = '12'.
      v_quarter = 4.
    ENDIF.
    IF v_quarter = 1.
      v_quarter = 4.
      v_year = sy-datum+0(4) - 1.
    ELSE.
      v_quarter = v_quarter - 1.
      v_year = sy-datum+0(4).
    ENDIF.
    CALL FUNCTION 'HR_99S_GET_DATES_QUARTER'
      EXPORTING
        im_quarter = v_quarter
        im_year    = v_year
      IMPORTING
        ex_begda   = v_quarter_begda
        ex_endda   = v_quarter_endda.
    WRITE:/5 'previous month begin date : ', v_month_begin_date.
    WRITE:/5 'previous month end date   : ', v_month_end_date.
    WRITE:/5 'previous quarter begin date : ', v_quarter_begda.
    WRITE:/5 'previous quarter end date : ', v_quarter_endda.
    Message was edited by:
            Velangini Showry Maria Kumar Bandanadham

  • FI : Finding last day of last accounting period

    Hi,
    In fi, I am trying to find out the last date od the last accounting period.
    I.e, if december is my first accounting period, and i give 28.01.2009 , my current accounting period will be 02,so last date of last period(december 2008) would be 31.12.2008
    Similalry, if December is the start of the accounting period,meaning december is accounting period 1, the, last day of the last accounting period would be: 30.11.2007.
    Please let me know of function modules to:
    1.Find the last period
    2.find the last day of the last period
    Thanks in advance..
    sumita

    Hi,
    You can try using function module LAST_DAY_IN_PERIOD_GET to get the last day in a month/period.
    You might have to check with the help of FI consultant what Fiscal Variant needs to be used.
    Also uou can find out the previous month by subtracting 1 from the current month ( and if month - 1 = 0 previous period is 12 ).
    Regards,
    Ram

  • Last Entry Date for Each Quarter

    Hi,
    I want to find out the last entry date for each quarter. The query I am using is this:
    SELECT 
    Country.Name as Country,
    CONVERT(DATE,MAX([CreationDate])) as LastDateOfClipEntry,
    DATEPART(Year,([CreationDate])) as Year,
    DATEPART(Quarter,([CreationDate])) as Quarter
    FROM 
    [dbo].[Clip]
    JOIN Office on Office.Code = Clip.Office
    JOIN Country on Country.Code = Office.Country
    WHERE YEAR(CreationDate) IN (@YEAR)
    GROUP BY Country.Name,DATEPART(Year,([CreationDate])) ,DATEPART(Quarter,([CreationDate]))
    ORDER BY Country.Name
    Now based on the column group I added in my report the result is coming correct but not properly formatted as I want.
    Below is the snapshot how its coming now:
    I don't want the extra blanks coming for each occurrence. There should be only one line for Australia and in the single line it should show the last entry date for that quarter. How can I achieve that ? Below is the snapshot showing current config:
    Thanks a lot in advance. Any help would be appreciated.
    Vivek Kamath

    Hi Vik2907,
    According to your description, you have a matrix which shows you those unexpected cells. Right?
    In this scenario, the reason caused this problem is the group setting. Mostly, you set the row group on a wrong field. As we tested in our local environment, if you set the row group on LastDateOfClipEntry, it will render the data as the screenshot you post.
    Please check both Row and Column Group setting, make sure they are group on proper field.
    Reference:
    Tables, Matrices, and Lists (Report Builder and SSRS)
    Understanding Groups (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Last date of the previous quarter

    Hi,
    How can i find the last date of the previous quarter, based on todays date (the fiscal year starting from 1st April)
    the quarters are 1st april to 30th June, 1st July to 30th sept, 1st Oct to 31st Dec and 1st Jan to 31st March

    872435 wrote:
    Hi,
    How can i find the last date of the previous quarter, based on todays date (the fiscal year starting from 1st April)
    the quarters are 1st april to 30th June, 1st July to 30th sept, 1st Oct to 31st Dec and 1st Jan to 31st MarchTry this function:
    select add_months(add_months(trunc(sysdate,'Q'),-1) - 1,1) from dual;
    Ion

  • What is the syntax to get last date of Quarter ?

    Hi ,
    We are planning to have Bom effective date functionality. Presently BOM Disable date is coming in between the Quarter. Is there any funtion or syntax to get last date of quarter for the bom disable date. similar to "$begin" to get the last date.
    Thanks

    Hi,
    To get this done you can do the following.
    1. Create the Result Source.
    2. Create the display template using the design manager and copy the existing template make the req. changes on the template and publish it to the document library and give the manage property that you req. for this concatenation functionality. Manage Property
    like the domain etc.
    3. Create search center and add the new page modified the core result web part and give the result source and custom template that created in step 2.
    4. Publish the page.
    5. Create the Search vertical and give the name and use the same page the created in step3. 
    http://sharepointfordeveloper.blogspot.in/2013/09/sharepoint-2013-result-source.html
    http://sharepointfordeveloper.blogspot.in/2013/09/sharepoint-2013-result-types.html
    http://sharepointfordeveloper.blogspot.in/2013/06/sharepoint-2013-design-manager.html

  • MDX to return last month of a quarter

    I have an MDX query where I need to return the last month of a quarter going back 2 years or 8 quarters.  I want the results to be like:
    Q1 2012   March 2012    #####
    Q2 2012   June 2012      #####
    Q4 2013   Dec 2013     #####
    I"ve tried this:  TAIL(Descendants(Lastperiods(8,STRTOMEMBER(@DataDate)), [Product Post Date].[Calendar].[Month] ),1 )
    but it's only returning the last monthe for the last Quarter and I need the last month for the last 8 Quarters.
    What am I doing wrong here ?   Thanks.
    J. Way

    You're welcome Judy!
    I'll do my best.  I think the simplest way to conceptualize the generate function (in this case, not the string concatination case for which it can also be used) is ...
    For each tuple/member in the first set (passed as a param), "apply" the 2nd set param to it.
    Union all the results together, and thereby "generate" a new set.
    What makes it useful is you can use CurrentMember to explicitly refer to members from the 1st set when doing this.
    Consider the following example ...
    As discussed in the
    MSDN definition, it is often used with TOPCOUNT.  If you need to show the top 10 products sold in each particular calendar year, generate a new set that for each year, derives the top 10 products, and then union all the results together into a newly
    generated set.
    Copy/paste from MSDN:
    ---------------------------------copy/paste start:
    The following example query displays the top 10 Products for each Calendar Year on Rows:
    SELECT
    {[Measures].[Internet Sales Amount]}
    ON 0,
    GENERATE(
    [Date].[Calendar Year].[Calendar Year].MEMBERS
    , TOPCOUNT(
    [Date].[Calendar Year].CURRENTMEMBER
    [Product].[Product].[Product].MEMBERS
    ,10, [Measures].[Internet Sales Amount]))
    ON 1
    FROM [Adventure Works]
    Note that a different top 10 is displayed for each year, and that the use of Generate is the only way to get this result. Simply crossjoining Calendar Years and the set of top 10 Products will display the top 10 Products for all time, repeated for each year,
    as shown in the following example:
    SELECT
    {[Measures].[Internet Sales Amount]}
    ON 0,
    [Date].[Calendar Year].[Calendar Year].MEMBERS
    TOPCOUNT(
    [Product].[Product].[Product].MEMBERS
    ,10, [Measures].[Internet Sales Amount])
    ON 1
    FROM [Adventure Works]
    ---------------------------------copy/paste end
    I hope that helps!
    Christian Wade
    http://christianwade.wordpress.com/
    Please mark correct responses as answers!

  • MDX to get last date MEMBER associated with a time LEVEL

    Hi there,
    I need to come up with a MDX calculation in my cube that takes an average 90 days forward from the last date member associated with whatever time level is being viewed in a time hierarchy.  Is this something anyone could help me with?  I can come
    up with code that is specific to a level (Year, Month, Week) but not one that is dynamic.
    Best,
    D

    I don't know exactly what you want from me.  I have a Time dimension with Year, Semester, Quarter, Month and Date.  I want to be able to get to the last date associated with a time member. So, for example, I would want to derive like this...
    October 31, 2014 would get to October 31, 2014
    October 2014 would get me to October 31, 2014
    Quarter 3 would get to to September 30, 2014
    Semester 2, 2014 would get me to December 31, 2014
    2014 would get me to  December 31, 2014

  • Expression - First date and last date of current month, current year

    Hi
    I need to have 2 ssrs expression as I can use  as default parameters in my report where I can -  out from my Time dimension, get the
    first date of the current, current year - and one where I get last date, current month, current year.
    My data source is a SSAS cube and my timedimension is structured like this:
    [Time].[Days].&[2009-01-16T00:00:00]
    Any suggestions how to solve this ?

    Hi ,
    You can use below in Default Values in ssrs ;
    for first Day of current month and year
    ="[Time].[Days].&[" +Format(dateadd("m",0,dateserial(year(Today),month(Today),1)), "yyyy-MM-dd")+"T00:00:00]"
    output will be ;
    [Time].[Days].&[2014-09-01T00:00:00]
    For last day of current month and year
    ="[Time].[Days].&[" +Format(DateSerial(Year(Now()), Month(Now()), "1").AddMonths(1).AddDays(-1), "yyyy-MM-dd")+"T00:00:00]"
    output will be ;
    [Time].[Days].&[2014-09-30T00:00:00]
    Please correct me if I misunderstood your requirement.
    Thanks
    Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem.

  • Getting data in a query on last date of all previous months

    Dear Experts,
    I need your help with a query.
    I am trying to create a query which when run should pick the number of Open Sales Order on the last date of all the previous months from the start of company.
    I could create the query for fetching the required data on last day of the previous month, say today is 25th June 2014, so my query only fetches data for May 31st 2014 but I need data for all previous month, May 31st 2014, April 30th 2014, March 31st 2014 & so on.
    Please advise how to achieve this is SQL query.
    Thanks & regards,
    Nitin

    Hi,
    Try this:
    Select *
    from(
    SELECT T0.[DocNum] as #,t0.cardcode as C, t0.docdate
    FROM ORDR T0
    WHERE T0.[DocStatus] = 'o' and T0.[DocDate]  = CONVERT(VARCHAR(10), DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,getdate())-1,0)),10) OR T0.[DocDate]  = CONVERT(VARCHAR(10), DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,getdate())-2,0)),10) or T0.[DocDate]  = CONVERT(VARCHAR(10), DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,getdate())-3,0)),10) or T0.[DocDate]  = CONVERT(VARCHAR(10), DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,getdate())-4,0)),10) or T0.[DocDate]  = CONVERT(VARCHAR(10), DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,getdate())-5,0)),10) or T0.[DocDate]  = CONVERT(VARCHAR(10), DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,getdate())-6,0)),10) or T0.[DocDate]  = CONVERT(VARCHAR(10), DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,getdate())-7,0)),10)
    group by t0.cardcode,docdate,T0.[DocNum]) S
    pivot
    (count(#) for c in([cvt01],[cvt02],[cvt03],[cvt04],[cvt05],[cvt06],[cvt07],[cvt08],[cvt12])) P
    Note: Replace Cvt01,02...with your customer code.
    Thanks & Regards,
    Nagarajan

  • Identify the last data package in start routine

    Hi Everyone
    We have a start routine in transformations. We require to do some special processing in the start routine only when the last data package is executing. How can we determine in the start routine that current package is last one or not ? Any pointers in this direction are appreciated.

    Hi,
    You can get packet Id from datapackid in start routine and end routine. But I'm not so sure how to identify the last packet ID, alternatively you can store this packet id in some where else and read the same value in End routine if your logic(processing) permits to do this in End routine instead of Start routine.
    METHODS
          start_routine
            IMPORTING
              request                  type rsrequest
              datapackid               type rsdatapid
            EXPORTING
              monitor                  type rstr_ty_t_monitors
            CHANGING
              SOURCE_PACKAGE              type tyt_SC_1
            RAISING
              cx_rsrout_abort.
    hope it helps...
    regards.
    Raju

  • Just moved to Mac from Windows, so far biggest headache is the way folders are treated. I manage several very large websites and involve a lot of files within folders and I need the folders to show the date the last file inside it was changed?

    In my FTP client I can click to sort by date modified which is fine if you are in a folder and then it shows the file dates correctly - but any folders within the root folder don't they seem to display randomly all together at the bottom of the list and it is a nightmare trying to find what folders have files in them that have been changed.
    Is there any way to get the folder to register the last date of a file within it that was modified?

    I dont know the answer yet, but i have noted what appears to be a bug in 10.9 in how it handles folder dates.  Right now i am seeing folder modified dates changing randomly ot "today" - whatever date the parent folder was opened.
    In the past my folders "modified" date was always the same as the last modified date of the items within.  But this only moved down ONE level - if a subfolder's entries were updated the "gradfather" folder did not update.
    But now severa people are reporting random, incorrect folder dates. I hoep this will be corrected soon, but who knows?
    Grant

Maybe you are looking for

  • LR4 from PC to Mac via ext drive - can't move folders

    I'm in the process of migrating from Windows (7) to an iMac which has been a partial success re Lightroom but I'm having problems with moving folders / files within LR (4.4) and could do with some advice please. On the Windows PC I had all of my phot

  • How to stop a process chain tempararly

    Hi we have a process chain BI (7.0) which extracts data from R/3 scheduled everyday at 6AM. However, our basis team is shutting down the R/3 server around this time for maintenance. I want stop the process cain for this day and start regular schedule

  • Screen defaults resets to low resolution

    I was working on my computer tonight, and my background picture changed, and the screen went to what appears to be a 256 color display, although it still appears to be 1440 x 900. The images and text are awful. I've checked the settings in the system

  • Delete Inventory Database

    This probably sounds stupid, but I'm looking for a way to just dump the current ZEN7 Inventory Database and start it from scratch. There's so much garbage workstation information in there, and I'm not at all interested in querying the results, then f

  • JPG is an unrecognized file format?!?! ***?

    I tried to download pics from my Kodak Z812 IS digital camera like have done no less than thirty times without any problems, and for some reason, now iPhoto says there was an error importing the pics because they are an unrecognized file format. They