turnover of 18 weeks from the week of the current month number

Hello

I have a requirement as described below.

Time table name:
Columns: year, month of exercise and exercise week

table above has the join with the sales table and contains data on sales according to the week. so less granularity of data at the level of the week.

We have a report that contains columns exercise, actual sales and forcast sales. our requirement is to filter the data with the following criteria.

Filter for the current month
Fiscal week Jan between 1-18 of the current year
Fiscal week Feb between 5-23 of the current year
Week fiscal March between 9-27 to the current year

.
.
.
.
Fiscal week November between 44 the week of the current year and week 10 of next year

December

with above requirement therefore filter the data bearing 18 weeks from the week of the current month number


I tried with timestampadd (interval, sql_tsi_week, week), but it does not work as I expacting. Please provide the code/logic to do so.

Appreciate your help.

Thank you
Jay.

Jay wrote:
I need to get the results of 18 weeks of turning to anypoint starting with the week number of the 1st of every month at 18 weeks. read my question again once and you will be able to understand.

It kind you of lack the point to be honest. It is very difficult to answer specific questions without the required information. To answer a question like this we need a minimum of:

1. oracle version
2. examples of data (CREATE TABLE / INSERT statements)
3. expected results
4. explanation of the business rules.

Alternatively, you can read the link in my original reply.

Please provide the information requested and someone can help.

Tags: Database

Similar Questions

  • Retrieve the current month

    Hi guys,.

    I'm recovering from the current month. The code is as follows:

    Calendar.getInstance (TimeZone.getTimeZone ("GMT")) .get (Calendar.MONTH)

    It works very well... I expect instead, he returned 11, not 12! He is 0-based? I don't think, because I have found no reference to this subject in the docs or here in the forums. Application for the work number current date as expected in fact.

    It returns 11 on the Simulator and real phones (a "BOLD" and a 8310). The system calendar is set correctly to December, of course.

    Any clue?

    Use no comparison with what is called "magic" numbers

    He has months constant defined in the Calendar class:

    public static final int DECEMBER
    

    Compare the return value with the constants that represent the months.

  • How to get the week of the current month

    Hi all
    Is it possible to find the week of the current month.

    Help, please...

    Hello...

    Use this feature to get the desired result.

    Hope it's okay...

    CEILING (DAYOFMONTH ("Time D0". "T00 calendar date") (/ 7.00) "

    Note: use 7.00 7 not only in the denominator*.

  • show only five dates Monday from the current date.

    All,

    I have the column date in dd/mm/yyyy format, I need to show the rear 5 date of Monday, from the current date.

    in the warehouse we t have the column NAME OF THE DAY.

    Help me.


    Thank you


    CASE WHEN DAYOFWEEK (DATE_FIELD) = 2

    AND

    DATE_FIELD > TIMESTAMPADD (SQL_TSI_DAY-35, CURRENT_DATE)

    AND DATE_FIELD<>

    THEN

    DATE_FIELD

    END

    Please check and change-35, according to the needs.

    Please check if it is correct.

  • currently still have PP CS5.5 &amp; want to install on another office, understand that I can only use one at a time. don't have a CD, can I get information from the current installation and a link to download PP CS5.5?

    currently still have PP CS5.5 & want to install on another office, understand that I can only use one at a time. don't have a CD, can I get information from the current installation and a link to download PP CS5.5?

    Download & install instructions https://forums.adobe.com/thread/2003339 can help

    -includes a link to access a page to download the Adobe programs if you do not have a disk or drive

    Find your http://helpx.adobe.com/x-productkb/global/find-serial-number.html serial No.

  • Why I don't get a response from the Dept. serial number already contacted them twice with ZERO response. I have included my product code and proof of my job as requested but nowt back! ??

    Why I don't get a response from the Dept. serial number already contacted them twice with ZERO response. I have included my product code and proof of my job as requested but nowt is back!

    Kingussie81 that I saw the account that you used to post on this public forum and your Creative Suite 5.5 Design Premium education serial number is registered under your account at http://www.adobe.com/.  For more information on how to locate your serial number registered please see quickly find your serial number.

    If you need to download a new copy installation files, they are available to Download CS5.5 products.

  • Return of records only for the current month

    Hello

    I have a query that returns records for the current week and I want to extend it for return records for the current month.

    When TRUNC (start_date) < NEXT_DAY (TRUNC (CURRENT_TIMESTAMP) - 1, "Sat") + 1
    AND TRUNC (end_date) > NEXT_DAY (TRUNC (CURRENT_TIMESTAMP) - 1, 'Sam')-7

    I have two date fields, the first is called 'Start_Date', the second is called 'End_Date '. I want the query to return all the records for the current month including those who may start before or end post the month as events can start in a month and end with another. Does anyone know how this is done in a "Clause where?



    Kind regards

    Steve Welch

    You probably want to

    where TRUNC (START_DATE) <= LAST_DAY(TRUNC(sysdate, 'MONTH'))
    AND TRUNC (END_DATE) >= TRUNC(sysdate, 'MONTH')
    
  • Return of the records for the current month, previous and next

    Hello.

    Robert Charlton contributed to my last question on this topic and thank him once more for this.

    When you filter the results of the report by using the following database returns records for the current week:


    WHERE 'SS_LEAVE '. "" LEAVE_TYPE "="SS_LEAVE_TYPE. " "" IDENTITY CARD ".

    AND)
    InStr (superior ("EMPLOYEE"), upper (nvl (: P2001_SEARCH, 'EMPLOYEE'))) > 0 or
    InStr (upper ("SUPERVISOR"), upper (nvl (: P2001_SEARCH, 'SUPERVISOR'))) > 0
    )
    AND TRUNC (end_date) < NEXT_DAY (TRUNC (CURRENT_TIMESTAMP) - 1, 'Sam') + 1
    AND TRUNC (end_date) > NEXT_DAY (TRUNC (CURRENT_TIMESTAMP) - 1, "Sat")-7


    My question is this time is:

    How to make a filter for the current month, the 'previous month', and 'next month '?


    Kind regards

    Steve Welch

    Steve,

    Current month:

    and trunc(end_date) >= trunc(current_timestamp,'MM') and trunc(end_date) < add_months(trunc(current_timestamp,'MM'),1)
    

    Previous month:

    and trunc(end_date) >= add_months(trunc(current_timestamp,'MM'),-1) and trunc(end_date) < trunc(current_timestamp,'MM')
    

    Next month:

    and trunc(end_date) >= add_months(trunc(current_timestamp,'MM'),1) and trunc(end_date) < add_months(trunc(current_timestamp,'MM'),2)
    

    -David

  • List date values in the current month and previous month next month

    Hello. I am looking for a way to query a list of each value date in the current month, previous month and next month.

    1 DECEMBER 15

    ...

    ...

    31 DECEMBER 15

    1ST JANUARY 16

    ...

    ...

    30 JANUARY 16

    1 FEBRUARY 16

    ...

    ...

    28 FEBRUARY 16

    Any help would be greatly popular!

    with the data (start_date and end_date) as)

    Select Add_months (trunc (sysdate, 'month'),-1),

    Add_months (trunc (sysdate, 'month'), 2)

    of the double

    )

    Select the level - 1 the_date + start_date

    from the data

    connect by level<= end_date="" -="">

  • You want to display the current month and previous month data in a single record on forms?

    Hello experts,

    I have this requirement:

    Table structure:

    Division of months value totalAmount

    01-apr-2013 1 10000

    May 1, 2013 1 20000

    01-apr-2013 2 30000

    May 1, 2013 2 50000

    I want to display in forms such as

    Form:

    Month: May 1, 2013

    Total difference of month Division total division prev_Month

    May 1, 2013 1 10000 April 1, 2013 1 20000 10000

    May 1, 2013 2 30000 April 1, 2013 2 50000 20000

    I use two procedure to fetch the records for the current month and the previous month.

    but it will cause a problem, if for some data division previous month do not arise.

    Please suggest me some query I can get with current and data month pre to unique record.

    Please help me.

    Thank you

    Yoann

    I DON'T KNOW BUT TRY...

    Select the month of x.mn, x.division, total x.totalAmount, y.mn prev_month, y.division, total y.totalAmount, (y.totalAmount - y.totalAmount) difference

    Of

    (select month mn, division, totalAmount value)

    from table_name

    where month = (select max (month)

    from table_name

    )

    ) x,.

    (select month mn, division, totalAmount value)

    from table_name

    where month = (select add_months (max (month),-1))

    from table_name

    )

    ) y

    where x.division = y.division

    /

    ALEXANDER SIMONNET

    DHAKA BANGLADESH

  • extracting remaning months of the year during the current month

    Hello

    I like allows you to retrieve the other months of the year from the current date.
    Can I do this?

    For example, it is today, July 23, 2012.
    Then, I would like to have:

    August
    September
    October
    November
    December

    Thank you
    Diana

    Hi, Diana,.

    Here's one way:

    SELECT     TO_CHAR ( ADD_MONTHS (SYSDATE, LEVEL)
              , 'Month'
              )    AS month_name
    FROM     dual
    CONNECT BY     LEVEL     <= 12 - EXTRACT (MONTH FROM SYSDATE)
    ;
    

    What output would you want in December?

  • Filter the current month!

    Hello Experts!

    I have two tables of facts (sales, reservations) and three dimensions (time, geography, product) in my diagram. I want to see the % change in the booking in the current month compared to last month. I have a column in the reservation called "% change", which calculates the percent of change in booking from last month. How can I filter the data for the month in progress at my table - time, a month in the form of text for example values. January 2010?

    I read some articles and OTN but have not found something useful in my case.

    Thank you!

    Hi Dan21,

    Set a dynamic variable repository in your RPD.

    Use the following SQL as source

    SELECT MONTH_YEAR INITCAP (TO_CHAR (SYSDATE, ' MONTH YYYY '))
    OF THE DOUBLE

    Having the variable repository update every day, in this way, it will automatically update the next month.

    Filter your report based on the variable repository, that you have created.

    Good luck and if you found this post useful, please reward points!

    Best regards

    -Joe

  • How to get the last date of 3 days for the current month?

    Hello. Guy

    How to get the last date of 3 days for the current month?

    MY OUTPUT WOULD LOOK LIKE THIS

    JANUARY 29, 2016

    JANUARY 30, 2016

    JANUARY 31, 2016


    GUYS HELP ME / / /...

    SQL > select last_day (sysdate) - level + 1 double connect by level<= 3="" order="" by="">

    LAST_DAY)

    ---------

    29 JANUARY 16

    30 JANUARY 16

    31 JANUARY 16

  • 1.2 calendar highlighting the current month

    I went to Nov 2009 & dec. 2009/2010 and calendar do not alleviate the current monthly view, as it does in other months.  What is happening to someone else?

    Mine display it correctly. Have you tried a reboot of the phone?

  • The previous/next Page number is showing that the current page number

    I'm trying pages numbers with previous Page number and the current Page number, then it is and shows that reason 002-003, but for some they are both appearing as the number of courses, so 003-003. The same thing happens if I try to insert the next Page number.

    I have this set up in the master page in a document issued in March and it works great - when I add new pages they are automatically numbered correctly. However, in a new document, or if I add a new text box to my old document, the Page number previous shows that the current Page number.

    Any idea of what is the cause? I use the latest InDesign on a Mac with os x 10.11.12. My colleague is having the same problem on his Windows PC.

    I am waiting to start a conversation with Technical Support, so I'll post the results.

    Hey Willi

    Thanks for your reply, we are both halfway there, it isn't fair for the lines break...

    I just checked my old document and there was a block of empty text hidden under something else on the previous page, which is linked to the image on the next page that holds page numbers. I need to insert a Page break at the beginning of the first text box to force the numbers on the following page. Now my second text box displays the previous and current page numbers.

    Problem solved!

Maybe you are looking for

  • Update iOS 10.0.2

    Hello I have my Iphone 5 c running on Ios 9.3.5. As expected, he downloaded the new Ios. If I go into settings-> general-> update software, it says downloading 10 Ios (seems to me always the original version of ios 10). However if I connect the Iphon

  • After the Windows 8.1 update, can not access Internet in Firefox or Chrome, but IE 11 OK.

    After the Windows 8.1 update, can not access Internet in Firefox or Chrome, but IE 11 OK.I reinstalled the latest firefox, still cannot access Internet from Firefox.Microsoft is ridiculous?

  • Properties of the controller PCI Simple communications in windows 8.1

    Update my PC in windows on HP Pavilion 500 - 307 x 8.1 (1) missing PCI Simple communication controller Hardware ID PCI\VEN_8086 & DEV_8C3A & SUBSYS_2AF7103C & REV_04 PCI\VEN_8086 & DEV_8C3A & SUBSYS_2AF7103C PCI\VEN_8086 & DEV_8C3A & CC_078000 PCI\VE

  • Replace a hard drive in dv6 but is not completed the installation phase

    I replaced my hard drive with a disks recommended by an expert from HP in this forum, and he seemed fine. After starting with my #1 recovery and loading of each disk when you are prompted, I got the final guest/message: "preparation of the recovery i

  • How to add music to slideshows dvd?

    Remember - this is a public forum so never post private information such as numbers of mail or telephone! Ideas: You have problems with programs Error messages Recent changes to your computer What you have already tried to solve the problem