Next month 7th day data

01-jan-09 5
02-jan-09 3
03-jan-09 2
01-feb-09 1
02-feb-09 1
03-feb-09 1
04-feb-09 1
05-feb-09 1
06-feb-09 1
07-feb-09 1
select sum(featured_moveouts) OVER (PARTITION BY propertynumber ORDER BY relavantdate
RANGE BETWEEN ADD_MONTHS (TRUNC ( relavantdate, 'MM'), 1)-relavantdate FOLLOWING
AND ADD_MONTHS (TRUNC ( relavantdate, 'MM'), 1) + 6-relavantdate FOLLOWING) "FW1_NEXT_MONTH_OUTS"
from fact_occupancy
if i give the above query i will get the sum of next months first week data if i give any date in jan
for example: if i give 09-jan-09 i will get the sum of next months first week data.. i,e 7
...i dont want that i need next months 7th(07-feb-09) day data if i give any date in jan
Edited by: sai praneeth on Mar 14, 2009 12:56 AM

I'm sorry but I don't understand... could you post the tables (CREATE TABLE statements) and some sample data (INSERT statements). And the expected outcome, the results.

Similar Messages

  • Function Module for calculating NEXT MONTH's start date and End date

    Hi Friends,
    I want a function module which could calculate the next months start date and end date...
    Say my input will be like 01.01.2006(start date) it should return
    01.02.2006 and 28.02.2006...
    IS there any FM for this ... or how to go about this scenario ???
    thanks in advance
    Cheers,
    R.Kripa

    Hi kripa,
    1. There is no DIRECT Way.
    2. We have to do in 2 steps.
    3. See this code (just copy paste in new program)
       U can use its FORM anywhere in your program,
       for getting the desired dates.
    4.
    REPORT abc.
    DATA : sdate TYPE sy-datum,
           edate TYPE sy-datum.
    PARAMETERS : dt TYPE sy-datum DEFAULT sy-datum.
    PERFORM getdt USING dt sdate edate.
    WRITE :/ sdate , edate.
    INDEPENDENT FORM
    FORM getdt USING orgdate stdate enddate.
      DATA : mydate TYPE sy-datum.
      CALL FUNCTION 'HR_PSD_DATES_ADD_MONTHS'
        EXPORTING
          v_date             = orgdate
          V_MONTHS           = 1
       IMPORTING
         E_DATE             = mydate
       EXCEPTIONS
         NOT_POSITIVE       = 1
         OTHERS             = 2
      CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
        EXPORTING
          iv_date             = mydate
        IMPORTING
          ev_month_begin_date = stdate
          ev_month_end_date   = enddate.
    ENDFORM.                    "getdt
    regards,
    amit m.

  • BIEE 10g combine month and day data in one report

    Hi
    I am trying to build a simple model to report employee absence per day against number of employees per month.
    There are two challenges:
    a) not setting content level of No_of_employees, drilling down along calendar to day level shows the Absence_day numbers, but not the number of employees for the month
    b) setting the content level of No_of_employees to month repeats the numbers correctly for each day in a month, but does not aggregate No_of_employees at a higher level (quarter or year)
    How do I achieve a report like this without loosing the ability to aggregate numbers at year level?
    Report sample
    Year     Month     Date     No_of_employees     Absence_day
    2012     June     06/01     15000               10
    2012     June     06/02     15000               8
    2012     June     06/03     15000               14
    2012     June     06/04     15000               5
    2012     June     06/05     15000               6
    OBIEE Version: 10.1.3.4.1 (not patched in a while)
    The calendar dimension has been build using OWB. Year, quarter and month level do contain negative dimension keys for values at these levels and f_employee joins to the negative values. The lowest level is day (positive dimension key values).
    Month June 2012; D_calender.dim_key = -50 (negative value !)
    Dates in June 01 - 30, D_calender.dim_key = 100 - 130 (positive values)
    Dimension: Calendar
    logcial levels: year - Quarter - Month - Detail (= date)
    logical key: Date
    LTS Fact 1: employees
    at month level
    physical join: f_employee.cal_fk = D_calender.dim_key
    measure: No_of_employees
    aggregation: sum
    logical:
    LTS content level: Calender dimension set to Month
    LTS Fact 2: absence
    at day level
    physical join: f_absence.cal_fk = D_calender.dim_key
    measure: Absence_day
    aggregation: sum
    logical:
    LTS content level: Calender dimension set to Detail (= date)
    Both facts are LTS for the same Logical Fact table.
    Thanks for your help
    Regards
    Andy

    The SQL I get when executing a request:
    If I could get Answers to display values of c9 instead of c5 (last few lines of the SQL), my problem may be solved
    WITH
    SAWITH0 AS (select D1.c1 as c1,
    D1.c2 as c2,
    D1.c3 as c3,
    D1.c4 as c4
    from
    (select sum(nvl(T116806.FRAVAERSDAG , 0)) as c1,
    T116670.DATO as c2,
    T116670.AAR_NR as c3,
    T116670.MAANED_NAVN as c4,
    ROW_NUMBER() OVER (PARTITION BY T116670.DATO ORDER BY T116670.DATO ASC) as c5
    from
    DM2.D_KALENDER_HIER T116670 /* Aggregation_D_Kalender_Hier */ ,
    DM2.F_FRAVAERSPERIODE_DAG_V2 T116806 /* Aggregation_F_FRAVAERSPERIODE_DAG_V2 */
    where ( T116670.AAR_NR = 2012 and T116670.DIMENSION_KEY = T116806.D_KALENDER_FK and T116670.MAANED_NAVN = 'April' )
    group by T116670.AAR_NR, T116670.DATO, T116670.MAANED_NAVN
    ) D1
    where ( D1.c5 = 1 ) ),
    SAWITH1 AS (select D1.c1 as c1,
    D1.c2 as c2,
    D1.c3 as c3
    from
    (select sum(T116663.ANSAT) as c1,
    T116670.AAR_NR as c2,
    T116670.MAANED_NAVN as c3,
    ROW_NUMBER() OVER (PARTITION BY T116670.MAANED_NAVN ORDER BY T116670.MAANED_NAVN ASC) as c4
    from
    DM2.D_KALENDER_HIER T116670 /* Aggregation_D_Kalender_Hier */ ,
    DM2.F_ANSAT_I_MAANED_LOENUDB_V2 T116663 /* Aggregation_F_ANSAT_I_MAANED_LOENUDB_V2 */
    where ( T116663.KALENDER_DIM_HIER = T116670.DIMENSION_KEY and T116670.AAR_NR = 2012 and T116670.MAANED_NAVN = 'April' )
    group by T116670.AAR_NR, T116670.MAANED_NAVN
    ) D1
    where ( D1.c4 = 1 ) )
    select case when SAWITH1.c2 is not null then SAWITH1.c2 when SAWITH0.c3 is not null then SAWITH0.c3 end as c1,
    case when SAWITH0.c4 is not null then SAWITH0.c4 when SAWITH1.c3 is not null then SAWITH1.c3 end as c2,
    SAWITH0.c2 as c3,
    SAWITH0.c1 as c4,
    cast(NULL as INTEGER ) as c5,
    SAWITH0.c1 as c6,
    SAWITH1.c1 as c9
    from
    Sawith0 Full Outer Join Sawith1 On Nvl(Sawith0.C4 , 'q') = Nvl(Sawith1.C3 , 'q') And Nvl(Sawith0.C4 , 'z') = Nvl(Sawith1.C3 , 'z')
    order by c1, c2

  • How to get the last day of the next month?

    Hi all.
    I need to get the last day of the next month. E.g. if the date is 20.03.2008 I need to get 30.04.2008.
    Is there any FM for it?
    TIA, Nikolai.

    hi Nikolai,
    pls. have a look athe following piece of code:
    PARAMETERS : p_date TYPE sy-datum.
    DATA : gv_res TYPE sy-datum.
    CALL FUNCTION 'CALCULATE_DATE'
    EXPORTING
    *   DAYS              = '0'
       months            = '2'
       start_date        = p_date
    IMPORTING
       result_date       = gv_res.
    ==> Now you have (gv_res) 2 months later as today
    gv_res+6(2) = '01'. ==> gv_res is first day of next-next month
    gv_res = gv_res - 1. ==> gv_res is last day of next month
    hope this helps
    ec

  • In Day view, how to jump to next month

    I've just updated to 10.7 and while there are so many things that annoy me about this iCal update, I'm going to try and focus on some very straightforward user interface options that were both solid and useful in 10.6 (and practically every other calendar software ever built) but have disappeared with the "Here's what we think you'd like in a Western Wear store if you were made to go into a western wear store and buy the fringey glitter eel skin boots you don't really want" update.
    In 10.6 in the day view, we could show multiple future months at a time by toggling an option in the lower left. Wow, pretty revolutionary. It's kind of like those paper calendars I've seen in Mad Men episodes from the 1950s that have an easy way to see many (or all) months at a time. Wow they had it good back then. In the 10.6 iCal software, it provides an easy way to jump to a future date to check on it (AND REMAIN IN DAY VIEW), which I'd say is a pretty essential part of a calendaring software program. One click, you're months in advance. One more click, you're back on today.
    In 10.7, we get the handy current month at top left with a big number (and an abbreviated day, ***?), but from what I can tell, absolutely no easy way to get to a day view in a future month. For example, it's Nov 22nd. If I want to check on Dec. 1, what does one have to do? Let's review the "updated" options-
    1. Click the day advance button 9 times
    2. Switch to month view, advance to the next month, then double click on the Dec. 1
    3. Use the event list tiny scroll bar to hunt the date down like the event carnivore that I am (Why am I forced to look at this event LIST anyhow, I just want a calendar - it's called iCal, not iList)
    4. View menu, go to date, and manually TYPE in a date? Not even a graphic month view here, like you'd find in, say, ANY system that lets you pick a date?
    But, maybe I'm missing something (other than 10.6)
    Please, someone out there tell me this is not an OMEN of untested, experimental, and ugly updates to come from Team Cupertino.
    Gonna go look at my eelskin boots now. Later y'all.
    Looking forward to your thoughts.

    Hi,
    any settings that are not possible in the XML, need to be set in the controller instead.
    Using the string value of an enum is fine, though.
    Regards
    Andreas

  • ICal moving an event to a new date, next week or next months,

    how do i drag my event from todays days to next months, i can not seem to drag an event from a date to another date unless its in the same week if in week view, or same month if in the mionth view, Their must be a simple drag function
    Message was edited by: CaptainStarwars

    CaptainStarwars,
    Dragging is not possible under the circumstances that you describe.
    You click on the event and use (⌘C) and then (⌘V). if you want to remove the event from the first occurrence use (⌘X), and (⌘V).
    ;~)

  • Function module to get the 'first day of next month'

    Hi
    I have a selection screen with  input fields
    1. period (month eg: 07)
    2.year(fiscal year eg: 2008 )
    If user enters 07 as month and 2008 as year, then I have to display 08/01/2008(MM/DD/YYYY) as output.
    Requirement is to calculate the  'first day of next month'
    I have written code for this requirement.But I am asked to use function mdule.
    Please help me in this regard.
    Thanks&Regards
    Rama.Mekala

    hi try this FM ...
    HR_JP_MONTH_BEGIN_END_DATE
    it gives the Begin Date and End date of the month
    rewards points if found useful
    regards,
    Balaji

  • How to keep showing items created in current month for 5more days only in the next month by OOB functionality only

    Hi,
    I have a Time Reporting site where users log in their time twice a month.This site uses only Out Of Box functionality. There is no scope for coding in my site.
    In the list i have created a view which shows the Time Report of the user logged in for the current month only.
    There is a new requirement : Current month's Time Report should be visible to the users in the next month for 5 starting days of the month only so that users can edit this month's Time Report in the next month's 1st 5days incase they forget to edit it in
    the current month.
    e.g: If i am absent on the last day of the month , my time report for this month(March) should be visible for 5 days in April so that i can stiil edit March's time report. However after 5days the Time Report for March should not be visible. After 5days only
    April's time report will be visible when submitted(April's time report).
    Please can anybody help me out with this.
    Regards ,
    Guru

    Hi Guru, you have a couple of options: 1) set a retention schedule through the list's settings> Information Management Policy Settings. Where the start date < start date + 35.
    2) create a view and filter by the date like above.
    These aren't perfect scenarios, but will get you close to what you want.
    cameron rautmann

  • Select records by date after first of next month

    Hi
    I have an asp app accessing a SQL Server db and am getting
    myself into a tangle over dates. I have a date field ValidFromDt
    (smalldatetime) and another date field ValidUntilDt which
    respectively define when a record is valid from and until. I want
    to select all records valid on the first of next month - i.e. were
    now in July so I want any whose 'valid from' date is now or any day
    up to 1 Aug but excluding those which expire before 1 Aug and also
    those whose valid from date is 2 Aug or later. Whatever month we're
    in, it is the first of next month I want to select up until.
    Any suggestions much appreciated.
    Thanks
    TP

    Try...
    SELECT yourTable.* FROM yourTable WHERE
    CSng(Month([ValidFromDt]))>CSng(Month(Date()))

  • 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

  • How to get next months date

    Hi. How do i return date records of next month?
    I am aware i may need sysdate.
    At the moment i have been trying:
    WHERE delivery_date = ADDMONTHS (sysdate, 1);
    No avail.
    Ideas?

    Hello
    If you mean you want to set up a range from the start of next month to the end of next month. This shows what happens when you apply add_months to sysdate
    SQL> select sysdate from dual;
    20-NOV-05
    SQL> select add_months(sysdate,1) from dual;
    20-DEC-05
    --Truncate sysdate to the first day of the month and then add 1 month
    SQL> select add_months(trunc(sysdate,'MM'),1) from dual;
    01-DEC-05
    --do the same, but use LAST_DAY to get the date of the last day next month
    SQL> select add_months(trunc(sysdate,'MM'),1),last_day(add_months(trunc(sysdate,'MM'),1)) from dual;
    01-DEC-05 31-DEC-05So with that in mind, you probably need to do something like
    WHERE
        delivery_date BETWEEN add_months(trunc(sysdate,'MM'),1) AND last_day(add_months(trunc(sysdate,'MM'),1));If you just want to get rows for "this" day next month you may well need to set a date range up especially if the delivery_date has not been truncated to set the time portion to 00:00:00
    WHERE
        delivery_date = ADD_MONTHS(TRUNC(sysdate),1))
    WHERE
        delivery_date >= ADD_MONTHS(TRUNC(sysdate),1))
    AND
        delivery_date < ADD_MONTHS(TRUNC(sysdate),1)) + 1HTH
    David
    Message was edited by:
    david_tyler

  • 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

  • When i login on game center it say enter your birth date when i enter it and i perss next the birth day will come again and again what should do

    when i login on game center it say enter your birth date when i enter it and i perss next the birth day will come again and again what should do

    Start a game with Game Center and go from there.

  • How to calculate the number of days until your next birthday. Only using current month, day and birth month and day.

    I'm trying to calculate the number of days until your next birthday. Only using current month, day and birth month and day. I can get close but i'm way off. When i enter in the next day, the amount of days is supposed to be 364. This is where I am having problems. I know my code is way off. I just need some guidance please!
    Attachments:
    D5.7_1.vi ‏8 KB

    I just had a little fun with the Time Record...
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    D5.7_1_BD.png ‏19 KB

  • Assign Month within a date range (by most days in a given month)

    I have a begin and end date, sample data as such
    select to_date('01-13-12','mm-dd-yy') from_dt,
    to_date('02-23-12','mm-dd-yy') to_dt
    from dual
    union all
    select to_date('03-15-2012','mm-dd-yy') from_dt,
    to_date('04-16-2012','mm-dd-yy') to_dt
    from dual
    union all
    select to_date('05-13-2012','mm-dd-yy') from_dt,
    to_date('07-23-2012','mm-dd-yy') to_dt
    from dual
    How do I assign a month by the most days in a month within that date range? Sometimes the date range might have the exact same amount of days in a month (like 3/15/2012 has 16 days and 4/16/2012 has 16 days). In this case, I want the earlier month (march).
    So from the sample data:
    01/13/2012, 02/23/2012, February
    03/15/2012, 04/16/2012, March
    05/13/2012, 07/23/2012, June
    Thanks
    Edited by: user4422426 on Mar 1, 2012 5:15 PM

    Hi,
    Here's one way:
    WITH     cntr          AS
         SELECT     LEVEL - 1     AS n
         FROM     (
                   SELECT      1 + MAX (to_dt - from_dt)     AS max_day_cnt
                   FROM     table_x
         CONNECT BY     LEVEL     <= max_day_cnt
    ,     got_r_num     AS
         SELECT     x.from_dt, x.to_dt
         ,     TRUNC (x.from_dt + c.n, 'MONTH')     AS month
         ,     count (*)                    AS cnt
         ,     ROW_NUMBER () OVER ( PARTITION BY  from_dt, to_dt
                             ORDER BY        COUNT (*)     DESC
                             ,             TRUNC (x.from_dt + c.n, 'MONTH')
                           )     AS r_num
         FROM       cntr     c
         JOIN       table_x  x  ON  c.n  <= x.to_dt - x.from_dt
         GROUP BY  x.from_dt, x.to_dt
         ,       TRUNC (x.from_dt + c.n, 'MONTH')
    SELECT     from_dt, to_dt
    ,     TO_CHAR (month, 'Mon YYYY')     AS mon
    ,     cnt
    FROM     got_r_num
    WHERE     r_num     = 1
    ;Thanks for posting code to create the same data. Please test your code before you post it: you got the order of arguments to TO_DATE reversed.

Maybe you are looking for

  • Downloads from NetLibray to Ipod

    I downloaded an ebook from NetLibrary to my Music Folder/ipod tunes. It was in the i pod tunes file but did not show up in the i pod tunes window. I did find it in Windows Media Player. I opened it up with Windows Media player and acquired the licens

  • How to globally change comment/pop-up color?

    I'm hoping there is some way to globally change the comment/pop-up color for an already-commented PDF. I work in design/production, and clients  provide all content revisions to me via PDF. The problem is, 10 times out of 10, the default commenting c

  • Have Premiere Pro CC, Need Encore, Can't Get to Premiere Pro CS6

    I had CS6 subscription, upgraded to CC a while back. Until about a year ago, I hadn't downloaded Premiere Pro because I don't usually do that kind of video editing. Now I have a video project for my family (a lot of them elderly) that I finally compl

  • Small file to big file

    Hi All, can anyone tell me how to convert a small file tablespace to bigfile tablespace? below is my database version Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bi PL/SQL Release 10.2.0.2.0 - Production CORE 10.2.0.2.0 Production T

  • How can I cancel  mistaken purchase from iTunes recently

    Would you be able to help me to cancel my recent purchase from itune that was done by mistake?