Current date, first day of month, last day of month, current week, current

Hi All,
may be the question will sounds basic for your guys, I am connecting via MDX a cognos reportnet on a BW 3.0B..due to loads of limitations on filtering via MDX on 'business date/time functions' , I would need to create in the infoqueries that are my data sources, the following additionnal objects:
- current date
- first day of current month
- last day of current month
- current week
- current year
I do not want prefiltered infoqueiries but object with these single values so that from reportnet I can have something like: OCALDAY between 'first day of current month' and 'last day of curent month'
Is there standard fonction for this under BW/BEX or if we need to developp functions has nayone some code examples.
thanks a lot for your great input
David

Hi,
In universe level if you want implement the requirede functions then you have to write custom sql and if you want to implement them in Reporting level then most of the functions are available to you. e.g. Quarter,Month, Year, Current Date....
Cheers,
Suresh A.

Similar Messages

  • Help:  Last Month Last Day till 12:00:00 PM

    Hello Folks,
    I am trying to get the last months last day in the query for developing a report. I have tried the code as below
       TRUNC (SYSDATE, 'MONTH') - 1  but it returns
    11/30/2009 12:00:00 AMbut i need to get the data up until 12:00:00 PM. Can anybody please throw some light on this.Thanks

    Hi,
    fsitja wrote:
    You shouldn't use a mixed syntax. Either you go ANSI on the whole FROM or you can use the Oracle join syntax for every table.Very well put! You CAN mix syntaxes, but it's confusing, and I've never seen an example where plain ANSI syntax doesn't get the right results more clearly.
    OP:
    If you say
    FROM "CUBS SNAPSHOT",client, CancelDesc
       INNER JOIN(...)then the parentheses must contain a sub-query, starting with SELECT (or maybe WITH).
    See [your previous message|http://forums.oracle.com/forums/message.jspa?messageID=3993062#3993062] for what you need to do if you want help.
    As mentioned in that thread, there is no need to group the INNER JOINS. The results will always be the same, regardless of what order the tables are joined.
    You can write the arithmetic expression:
    5 + x + y + 1lots of different ways, including
    5 + (x + (y + 1))
    ((5 + x) + y) + 1
    (5 + x) + (y + 1)
    (5 + x + y) + 1
    5 + (x + y) + 1and it may be a good idea, if it makes your code clearer, so human beings can understand it more easily. But the results will always be the same, no matter how you group the addition operations.
    In the same way, no matter how multiple INNER JOINs are grouped, the results will be the same. I can't think of any situation where clarity would be enhanced by spelling out a join order.

  • BIP eBusiness Suite Dates - How to include the last day of the month?

    How can I get my report to include the last day of the month 'without' forcing my users to enter the non-intuitive first of the next month as a parm?
    I have a report that will generally be run for a month but can be run for any pair of dates representing the first and last date to be included in the report.
    When we pass the dates from Oracle Apps to the report it is truncating the date to midnight. This results in the last date entered 'NOT' being included in the report as the second date is marked as "midnight". When I attempt to simply add "=1" to the end date it fails due to formatting issues in apps (only). I have gotten this to work on our Enterprise edition server that we use for testing (only) but it fails in our apps environment.
    In APPs we input the date in the format "01-AUG-2007", and this is how it shows in the parm line before the report is submitted as well as in the "View Details" after the report is executed: http://home.swbell.net/grog1//work/req_details_5607586.jpg
    However it is odd in that we in the "View Log" entry it shows the date formatted as "2007/08/01 00:00:00": http://home.swbell.net/grog1/work/view_log_5607586.jpg
    Even odder is that under diagnostics, "View XML" the date is formatted third way as: "2007/08/01 00:00:00.0" (note it now includes tenths of a second): http://home.swbell.net/grog1/work/view_xml_5607586.jpg
    This of course makes it difficult to perform conversions and calculations on the date in the SQL.
    Is APPs doing some sort of 'timestamp' conversion?
    How can I get my report to include the last day of the month 'without' forcing my users to enter the non-intuitive first of the next month as a parm?
    Any feedback is appreciated,
    Scott

    No. The problem/error occurs long before the data is formatted into xml for presentation to the format template.
    The error occurs in the SQL in the 'data' template when I attempt to add a day to the date. It either does not like the implicit conversion with the "+1" and then the use of the "between" with another date or if I attempt to manually convert it has problems with the format mask.
    Scott

  • Object date - how to get the last day of the month?

    hi all,
    I have a date object in which I would like to get the last day of the month. any idea?
    eg AUG=31
    Feb = 28 (depends if a leap year)
    thanks

    Use java.util.Calendar
    Add 1 month to the day.
    Set the day of month to be 1.
    Subtract 1 day.
    Now you are on the last day of the month you wanted.

  • Auto change Posting date to current date in Service Entry on approval day

    Hi Guru
    The scenario is:
    User is creating a Service Entry (SE) ML81n
    The Posting date X is taken automatically as today's / sys date in SE
    The SE goes for approval in Approver's inbox.
    Approver is taken to SE when presses approval button on X+1 date i.e. the next day.
    In SE the posting date is still the same as X
    Posting Date automatically change to X+1 in SE.
    (I found that this issue does not have link to workflow,  i ts only in ML81n we need to look in. or there may be other opinion)
    Pl help in understanding to get this change automatically done.
    Best Regards

    There are two date fields in the accept data tab.
    1> Document date: The date at which the service entry sheet was created
    2> Posting date: When the entry sheet is created but not approved then
    document date and posting date are the same.The document date is updated only when the entry sheet is approved.
    If there are multiple levels of approval, the posting date will reflect the date last approval and will be updated with the date of final approval when the sheet is finally approved.
    Hope this has helped you !
    Regards,
    Aviator

  • How to get Last Day of a Previous Month

    Hi all,
    I need to get Last Day of the Previous Month. I am able to get Current Month Last Day using Calendar.getActualMaximum(Calendar.DATE)
    But I need previous Month's Last Day.
    Thanks
    Vamshi.

    Thanks all....
    I have been trying the same and could get it.....
    here is the code for that....
    SimpleDateFormat simpleDate = new SimpleDateFormat("MM/dd/yyyy");
    Calendar calendar = Calendar.getInstance();
    month = calendar.get(Calendar.MONTH);
    //year = calendar.get(Calendar.YEAR);
    calendar.set(Calendar.MONTH, month-1);
    calendar.set(Calendar.DATE, calendar.getActualMaximum(Calendar.DATE));
    //lastDayOfMonth = calendar.getActualMaximum(Calendar.DATE);
    System.out.Println("Previous Month End Date is :: " + simpleDate.format(calendar.getTime()));
    this works....
    thanks for ur replys....

  • Previous month first data and previous month last date

    can any body have query to get previous month first date and previous month last date.
    Ex: First day of the previous week:
    TIMESTAMPADD(SQL_TSI_DAY,-6, (TIMESTAMPADD(SQL_TSI_DAY, DAYOFWEEK(CURRENT_DATE) *-1,CURRENT_DATE)))
    Last day of the previous week:
    TIMESTAMPADD(SQL_TSI_DAY, DAYOFWEEK(CURRENT_DATE) *-1,CURRENT_DATE)
    can anybody have it for first day of the previous month,last day of the previous month?
    Edited by: user12255470 on Apr 7, 2010 3:30 AM

    Hi,
    1st day of previous month :
    TIMESTAMPADD(SQL_TSI_DAY, ( DAYOFMONTH(TIMESTAMPADD(SQL_TSI_MONTH,-1,CURRENT_DATE)) * -1) + 1, TIMESTAMPADD(SQL_TSI_MONTH,-1,CURRENT_DATE))
    last day of previous month :
    TIMESTAMPADD(SQL_TSI_DAY,DAYOFMONTH(TIMESTAMPADD(SQL_TSI_MONTH,-1,CURRENT_DATE)) * -1 , TIMESTAMPADD(SQL_TSI_MONTH, 1, TIMESTAMPADD(SQL_TSI_MONTH,-1,CURRENT_DATE)))
    Please mark Q answered and award points for correct answers !
    Thanks
    Alastair

  • Query for back 2nd motnh first day and last day

    Any body please provide me the query for back 2nd month first day to back 2nd month last day?
    last month first day
    TIMESTAMPADD(SQL_TSI_MONTH,-1, TIMESTAMPADD(SQL_TSI_DAY, -(DAY(CURRENT_DATE)-1), CURRENT_DATE))
    last month last day
    TIMESTAMPADD(SQL_TSI_DAY, -(DAY(CURRENT_DATE)), CURRENT_DATE)
    anyone please provide me the queries for previous months like above queries?
    2nd back month first day --?
    2nd back month last day--?
    3rd back month first day --?
    3rd back month last day --?

    Hi,
    Check with this...
    Previous month last day -
    TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE)
    Last day of 2nd month -
    TIMESTAMPADD(SQL_TSI_MONTH,-1,TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE))
    Last day of 3rd month -
    TIMESTAMPADD(SQL_TSI_MONTH,-2,TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE))
    (OR)
    Previous month last day -
    TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE)
    Last day of 2nd month -
    TIMESTAMPADD(SQL_TSI_DAY,DAYOFMONTH(TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE))*-1,TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE))
    Last day of 3rd month -
    TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(TIMESTAMPADD(SQL_TSI_DAY,DAYOFMONTH(TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE))*-1,TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE)))*-1,TIMESTAMPADD(SQL_TSI_DAY,DAYOFMONTH(TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE))*-1,TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE)))
    Regards,
    Srikanth

  • Convert two dates difference to number of years, months and days

    Post Author: gigimonu
    CA Forum: Formula
    I wanted to write a formula (if there is a function I can use) that can convert a date difference to total number of years, months and days example
    adate = 10/22/2006
    ?xdate = current date - adate (answer should be 1 years, 0 months and 0 days)
    Please help
    Thanks

    Post Author: V361
    CA Forum: Formula
    [Years, Months, Days]
    DATEVAR FROMDATE := DATE(2000,01,01); // FROM DATE
    DATEVAR TODATE := CURRENTDATE; // TO DATE
    NUMBERVAR YEARS;
    NUMBERVAR MONTHS;
    NUMBERVAR DAYS;
    STRINGVAR DIFF;
    DATEVAR TEMP;
    IF TODATE < FROMDATE THEN
    (TEMP := TODATE;
    TODATE := FROMDATE;
    FROMDATE := TEMP);
    YEARS := DATEDIFF('YYYY',FROMDATE,TODATE);
    IF YEARS > 2 THEN
    (YEARS := YEARS - 2;
    TEMP := DATE(DATEADD("M",YEARS * 12,FROMDATE));)
    ELSE
    (YEARS := 0;
    TEMP := FROMDATE);
    WHILE TRUE DO
    (TEMP := DATE(DATEADD('M',1,TEMP));
    IF TEMP > TODATE THEN
    EXIT WHILE;
    MONTHS := MONTHS + 1);
    DAYS := DATEDIFF('D',DATE(DATEADD('M',-1,TEMP)),TODATE);
    IF MONTHS > 12 THEN
    (YEARS := YEARS + INT(MONTHS/12);
    MONTHS := MONTHS MOD 12);
    DIFF := IIF(YEARS>0 ,TRIM(TOTEXT(YEARS,0)) & " YEARS " ,"0 YEARS ") &
    IIF(MONTHS>0,TRIM(TOTEXT(MONTHS,0))& " MONTHS ","0 MONTHS ")&
    IIF(DAYS>0 ,TRIM(TOTEXT(DAYS,0)) & " DAYS" ,"0 DAYS");

  • 2 months Before Last Days

    How to create Previous two months last day date in OBIEE?
    Example:
    If I am in August, 2010, then
    Last two Previous Month(Jul 31, 2010) supposed to be display.
    Edited by: Welcome99 on Sep 3, 2010 1:55 PM

    You said two different things, if you want "previous two month's last day," then in your example, that would be June 31, 2010. The code below describes this.
    TIMESTAMPADD(SQL_TSI_MONTH,-1,TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE))
    (For September 2010, this will give you July 31, 2010)
    However, if you meant July 31, 2010 should display if "this month" is August 2010, then you meant "previous month" not "two months ago." The code for this is below:
    TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE)
    (For September 2010, this will give you August 31, 2010)
    Test both and see which one you are asking for.

  • Number  of days (current date-goods receipt date)

    Hi All,
    I have a requirement like this :
    need to display no of days in Query which is CKF=current date-GR date.  GR date is coming from r/3.We do not have current date field. and moreover no of days is in the selection screen.So we should have no of days calculated already in the cube.am i rght? calculation shold be done before data comes into the cube i.e in transfer rules or update rules...thats what i thought.Am i rght? can anybody come up with some code to calculte no of days in transfer rules or update rules?
    pl correct me if i am wrong.
    regards
    Message was edited by: cmd

    When your write code in transfer rules it will be global.
    if u write code in update rules it will local to on data target.
    Transfer rules----
    InfoSource
    Update reules----
    data target.
    here infosource is re-usable to other datatargets, so it will effect to all.
    but update rules is only one data target.
    i think u clar about this.
    pls assgain poinst, if u satify.
    by
    ANR

  • Last month end date based on current date

    Hi,
    How to show last month end date based on the current date.
    Eg:
    Current date = "08/26/09"
    Var- Last Month End Date = "07/31/09" etc...,
    Please help me how to get it...
    Thank You!

    Good to hear that it worked for you. but not for me.
    I tried like this:
    1st::
    1. var1= ToDate("06/30/09","MM/dd/yyyy")
    2.Var2= RelativeDate([Var1];-DayNumberOfMonth([Var1]))
    result: 5/30/09
    2nd:
    RelativeDate('6/30/2009';-DayNumberOfMonth('6/30/2009'))
    result: 5/30/09
    Am working on SAP OLAP cubes.
    Please help me where am going wrong....
    Thank You!

  • How to fill a prompt in webi with current date?

    A webi report is being generated on BEx Query.
    IN BEx query variables are defined for some date fields to prefill them with current date.
    Foe ex. there is license start date. For this field variable is defined so that in variable screen License start date is automatically filled with greater than or equal to current date(which is system date). WHich is a mandatory variable.
    On BO side, a webi report is being developed on a Universe (based on this BEx query).
    When the webi report is run, the license start date(mandatory variable in BEx) is automatically prompted, but date is not getting prefiiled with current date.
    How to prefill this prompt with current date?
    the prompt should be like
    LIcense start date >= <current date>

    Hi,
    Yes, it isn't possible to reference anything like 'Current Date' in the universe (like you would with a SQL data source).
    The solution I have seen recently goes like this, I don't know the exact details (so I might have some terminology wrong), but someone with ABAP skills should get what I mean.
    Assuming you want to filter on 0CALDAY.
    In ABAP, create a customer EXIT that calculates the current date as a number (so today might be 40651). Do the same for 0CALDAY.
    In the BEx create a formula variable that references each of those, then a Formula Key Figure (I forget the exact name of them) that's just the current day number minus the 0CALDAY number. This gives you the 'age' of that row of data.
    Your Webi report can then have a built in filter (or prompt with a default value) of, say Age <= 30. The report can be scheduled and will always run with the last 30 day's data.
    We actually did the customer exists to show the 'age' in months.
    Sorry I can't explain it any better, but it's working great for us.
    Hope that helps.

  • Current date - End of the week

    Hi Masters,
    By using <b>GET_WEEK_INFO_BASED_ON_DATE</b> this function module we can find the last day of the week.
    That is it's giving SUNDAY. But my case SAT DAY is the last day of week. Please can any body give me the proper code..It's very urgent..
    I realy appricate..
    Thanks!
    SReddy

    try this ( I am in ECC 5.0 just check it in your version)
    data : vdate  like sy-datum,
           vsatday like sy-datum.
           vdate = sy-datum.
    CALL FUNCTION 'HR_GBSSP_GET_WEEK_DATES'
      EXPORTING
        p_pdate             = vdate
    IMPORTING
    *   P_SUNDAY            =
       P_SATURDAY          = vsatday
    *   P_DAY_IN_WEEK       =
    *   P_WEEK_NO           =
    write : / vsatday.
    regards
    shiba dutta

  • Posting a full years worth but only display current date

    i am wondering how i go about posting my rss feed for the whole year but only allow itunes to read the current date? i understand from research that it takes the most current date and uses that as the first. but if i wanted to display September's 06 podcast in September and not July's 07 then how would i do that. i have seen some software that you can purchase that will do this for you, but i would rather code it my self or with the help of others. does anyone have any ideas on how this is done? or have you done it your self. any thoughts or ideas are very welcomed.

    not quite. i have cooking videos that i would like to be availbe new episode every 2 weeks. so my rss feed is set up with 27 diferent items, because 52/2=27 52 is the number of weeks. any who so there are 27 diferent items in the rss feed all with the diferent dates. (item 1= aug 30, item 2=sept sept 13, item 3= sept 27....) but on sept 13 the only items that should display would be the aug 30th and the sept 13th. but when sept 27th roles around all prev. are displayed includeing the new sept 27th episode.
    i understand that i can just reupload the rss feed and ping the system. but i am just trying to see if i can do this automated style for ease of use and to be able to concentrate on other things.
    thank you for your quick reply.

Maybe you are looking for