Get data from YEAR_WEEK for the next WEEKS 20

Hi all

I have a select query and when I run this query, that query is display data for all YEAR_WEEK of PROD_BACKLOG table. The YEAR_WEEK column in the PROD_BACKLOG table data in this format 2030-WK41.

My select query is the following
SELECT 
              DC_UTIL.GEN_YEAR_WEEK(MSD) YEAR_WEEK,
              ITEM_NUMBER,
              BACKLOG_QUANTITY,
              MSD
              to_char(MSD, 'IW')
              FROM prod_BACKLOG
              where to_char(MSD, 'IW')>to_char(sysdate, 'IW');
I would like to add a clause in this query should it search only for data for the next few weeks more 20.

Thanks in adavnce

Concerning

Hello

I think that you have given for more than a year, which is why queries of does not return the same number of lines:
-For your TO_CHAR, you keep only the week number and don't care of the week, which means that the 29th week of 2011 is the same as the 29th week of 2012
-With the TRUNK, you compare the first days of the week, which include information on the year

Here is an example: you'll see Date1 is the same for 2 dates, but Date2 shows different results and take care of the year:

with t as (
select to_date ('20/07/2011','DD/MM/YY') MSD from dual union all
select to_date ('20/07/2012','DD/MM/YY') MSD  from dual
) select to_char(MSD, 'IW') date1, trunc (MSD, 'IW') date2 from t;

DATE1      DATE2
---------- ---------
29         18-JUL-11
29         16-JUL-12

You must choose the trunc.

Using< or=""><= in="" this="" part="" of="" the="" where="">

and trunc(MSD, 'IW')<=trunc(sysdate+140, 'IW');

won't change of data greater than the week or not, but will include or not data for the 20th week.

Hope that is more clear.

Kind regards
Sylvie

Tags: Database

Similar Questions

  • Getting data from DB for each page load

    Hello

    I use JDevloper 11.1.1.4. I have display objects in the child-parent relationship of level three.

    For example viewobject1 (grandparent), viewobject2 (parent), viewobject3 (child). I want the amount of a particular attribute in viewobject3 be changed dynamically based on the exploitation of the page in which viewobject3 is linked. Suppose that the page contains a table. This table has a column 'paying '. I want that the total of the column "compensation". I added in the bottom of the column in the table. When deleting a row in a table the total should be amended accordingly.

    I believe that groovy is preferable to use in this case. That's why I tried both approaches.
    (1) we must, an attribute viewobject3 as transitional and use groovy (sum ("pay")); in its value field. This generates an error "name not found in the given object sum: ViewRow [oracle.jbo.Key [492339-7597]].»
    (2) the other is to, have a transitional attribute in viewobject2 and the calculation of the sum expressed in groovy (view3.sum ("pay")). But this results in the page quite rarely. In other words, when you load for the first time, it shows correctly. After deleting a record, he makes sometimes total and sometimes not.

    These two approaches does not seem to work.

    Could someone tell me if I am following an appropriate approach

    Kind regards
    V. Praveen

    Published by: Praveen Sep 26, 2011 16:45

    Could you pls try this

    object.getRowSet (.sum ('Pay'))

  • Y510 unable to get data from the camera.

    Hello

    I have a Y510 with Windows Vista 32 bit, 3 GB RAM, only 5 weeks. I get this message when I try to use Veriface, "unable to get data from the camera. The camera may have been disconnected or busy. I reinstalled Vista of the State in which the laptop came, but it does not work. I also updated the bios and install other updates were available. I would appreciate any advice.

    Thank you

    Peter

    I wish it was as easy as press Fn + Esc, I looked through an another Y510 our office and managed to find a process that must be set to Auto, the process is KtmRm. This process cannot be disabled, handicapped, or on a time delay, it must be AUTOMATIC.

  • Get data from a member of the region partitioned customer

    Hello

    I have a partitioned area, this region is in all 3 members, is it possible to get data from this region but only from 1 member of the customer, if so how?

    What is your definition of the region on the server? The three members have given? You set redundant copies? In addition, if the optimizeForWrite() of the service method returns false, the function will run the smallest number of nodes.

    Follow these steps:

    The redundant copies of the value = 1

    Returns true for optimizeForWrite()

    Make sure that all members contain primary buckets

    Perform function like you do above

    Barry

  • birthMonth-String to the Date of Conversion - get data from this month

    Hello

    We would like that the EEG records results for birthmonth this month table. If this month is May (05) then I need to get records of Birthmonth for the month may of table.

    {Code}

    Create table birthmonth (birthmonth Varchar2 (10), Numeroclient number);

    INSERT INTO BIRTHMONTH ('1', 100);

    INSERT INTO BIRTHMONTH ('2', 101);
    INSERT INTO BIRTHMONTH ('3', 102);
    INSERT INTO BIRTHMONTH ('41', 103);
    INSERT INTO BIRTHMONTH ('5', 104);
    INSERT INTO BIRTHMONTH ('10', 105);

    INSERT INTO BIRTHMONTH ('11', 106);

    {code}

    Hello

    user1758353 wrote:
    Hello

    We would like that the EEG records results for birthmonth this month table. If this month is May (05) then I need to get records of Birthmonth for the month may of table.

    Here's one way:

    SELECT  *
    FROM     birthmonth
    WHERE     birthmonth     = TO_CHAR ( SYSDATE
                            , 'fmMM'
                          )
    ;
    

    SYSDATE returns the date of the day.
    To_char (SYSDATE, 'MM') returns the current month (a string 2, with a '0' for most of the month).
    To_char (SYSDATE, "FMMM") returns the current month (a string 1 or 2, without a '0').

    {Code}

    Create table birthmonth (birthmonth Varchar2 (10), Numeroclient number);

    INSERT INTO BIRTHMONTH ('1', 100);

    INSERT INTO BIRTHMONTH ('2', 101);
    INSERT INTO BIRTHMONTH ('3', 102);
    INSERT INTO BIRTHMONTH ('41', 103);
    INSERT INTO BIRTHMONTH ('5', 104);
    INSERT INTO BIRTHMONTH ('10', 105);

    INSERT INTO BIRTHMONTH ('11', 106);

    {code}

    Thanks for posting that, but no instructions INSERT works; they need the keyword VALUES.
    Always test (and, if necessary, correct) CREATE TABLE and INSERT statements before committing.

    Is it really wise to save only the month? Most often, people store all birth_date in a DATE column. It is easy to use EXTRACT or TO_CHAR to get the month of a DATE.
    Because you really want to use a column of VARCHAR type, making 10 characters long guest just wrong. Why not make 2 characters? In addition, add a CHECK constraint to make sure invalid month, such as '41' above, does.

  • How can I get data from each associated XMLnode in movieclips separated when you click a line in the combobox

    How can I get data from each associated XMLnode in movieclips separated when you click a line in the combobox?

    A sample of XML is like this:

    <>planter

    < Lauvtre >

    < Botanisk_navn > Acer campestre < / Botanisk_navn >

    < Norsk_navn > Naverlonn < / Norsk_navn >

    Gronn < Farge > < / fan >

    H4 < Herdighet > < / Herdighet >

    < Hoyde > 10-15 m < / Hoyde >

    < / Lauvtre >

    I have a combobox where it shows the botanical name and the Norwegian name. But the rest of the info in movieclips seem separate.

    Someone has an idea how to do this? Can I use the trace function maybe? Here is my AS3 code so far:

    var loader: URLLoader = new URLLoader();

    loader.addEventListener (Event.COMPLETE, onLoaded);

    list.addEventListener (Event.CHANGE, itemChange);

    function itemChange(e:Event):void

    {

    your. Text = list.selectedItem.data;

    TB. Text = list.selectedItem.label;

    }

    var xml;

    function onLoaded(e:Event):void

    {

    XML = new XML (e.target.data);

    var it: XMLList = xml. Planter.Lauvtre;

    for (var i: uint = 0; i < il.length (); i ++)

    {

    list.addItem ({data: it.}) Farge.Text ([i]) + "\n"+ it.» Herdighet.Text ([i]) + "\n" + it. Hoyde.text ([i]),

    label: it. Botanisk_navn. Text() [i] + "\n"+ it.» Norsk_navn. Text() [i]});

    }

    }

    Loader.Load (new URLRequest ("lauvtre.xml"));

    Thank you!

    Rheus.

    I don't know what you're trying to do.  but, if you want to fill one combobox with the botanical names and when one is chosen, the other use of logins:

    var loader: URLLoader = new URLLoader();

    loader.addEventListener (Event.COMPLETE, onLoaded);

    list.addEventListener (Event.CHANGE, itemChange);

    function itemChange(e:Event):void {}

    var selectedObj:Object = a [list.selectedIndex]

    trace (selectedObj ['fan'], selectedObj ['Botanisk'], etc);

    }

    var xml;

    var a: Array = [];

    function onLoaded(e:Event):void {}

    XML = new XML (e.target.data);

    var it: XMLList = xml. Lauvtre;

    for (var i: uint = 0; i

    list.addItem({label:il[i].child('Botanisk_navn').toString()});)

    a [i] = {'Fan': it [i].child('Farge').toString (), 'Herdighet': it [i].child('Herdighet').toString (), "Hoyde": he [i].child('Hoyde').toString (), 'Botanisk':il[i].child('Botanisk_navn').toString(),'Norsk_navn':il[i].child('Norsk_navn').toString()};}

    }

    }

    Loader.Load (new URLRequest ("test.xml"));

  • How to get the date of deployment for the RT code?

    I'm using LabVIEW 8.5 and MAX 4.4.1f0 and cFP-2110. I want back the date of the deployment. Is it possible to recover the date of deployment for the RT code?

    Thank you

    Martine

    Hi John,.

    You must be able to FTP into your PSC 2110 from a Windows Explorer window and check the date of 'Change' of the startup.rtexe/or-rt/startup folder.

    Aaron P

    National Instruments

    Technical sales engineer

    http://www.NI.com/support

  • How can I change password to get into my computer? I am now in my computer, but want to change for the next time I open it.

    How can I change password to get into my computer?  I am now in my computer, but want to change for the next time I open it.  Thank you.

    Click Start, click your account at the top right picture, click on 'change your password '. You must then enter the old password and a new.

  • Get windows store is unavailable, please try again later "for the 3 weeks, what gives?

    Hi MS community

    I just bought a new Acer win8 laptop computer s7 on Amazon.com, but I get "Windows store is unavailable, please try again later" for the 3 weeks.

    Is there a geographical restriction that I'm not a wear of since I reside in Barbados?

    Steven

    Hello

    Run the working WSReset.exe - Win8.1 update being downloaded.

  • I do a layout of paper every two weeks; This time, when I opened my model, set up for the next issue when I typed 'W' to display the grid I have something totally different than previously, a background grid which is more annoying.  Why in the world

    new to InDesign 6 months I do a newspaper page layout every two weeks.  This time, when I opened my model, set up for the next issue, when I typed "W" to display the grid, I have something I never saw elsewhere. ".  The background was filled with a new grid of tiles rather than the void behind the newspaper that I'm used to seeing.  I don't know what happened, but it seems that Adobe has tinkered once more with the program.  The last time this happened, I lost the icon "cover the columns" at the top; now, it's a case of two steps to put the head-lines across more than one column.  NOT useful.

    There is probably a command or a term, I don't know that this right but my main question is why, when I did this dozens of times before, doing something different will come this time.  (I know, without replica.)

    I'd also appreciate comments that someone out there could offer re why now when I tap on InDesign, is there a slight pause before that something happens to the screen.  What is my new Mac, or something to do with the program that I can fix it?

    Thanks, Sacie

    It looks like the grid of the document, which can be disabled in the view menu.

  • Laptop Acer V3 - 571 will not get increased from 22% of the anniversary "Update" for Windows 10 part of the installation

    I have an Acer laptop V3-571, initially w / Windows 7 Home, which I've updated to Windows 10. Site Acer says that this laptop will support the 10 anniversary Win update.

    Tried to download the update of the anniversary online, but came back to win 10. Switched to Windows Media Creator for the next download attempt, I uninstalled my avast! Internet security. Back in return once again. Then reused Win Media Creator (after I deleted also Malwarebytes Anti - malware & also Anti-Exploit SuperAntiSpyware & Malwarebytes. After fully downloading birthday update (Win 10 AND updates), came after new Win 10 and 22% of updates. And here AGAIN once I had turned off the Bluetooth drivers, I have downloaded the update of the birthday & again once the mark of 22%, the updates to the new download to win 10 birthday, my machine back the previous Win 10.

    Someone at - he heard of this? Any suggestions?

    What's the brand of 22% the machine restarts (which is the second restart during the installation of birthday) and shows that my machine is back to the previous version of Windows?

    Thanks in advance.

    To clarify: after the anniversary update all downloads without problem, the anniversary part of Windows 10 installs without problem. Then "Updates" to begin the installation, at the helm of the 22% of these "Updates" install, the machine restarts and returns to the previous installation of Windows.

    SOLUTION: Finally, yesterday, I downloaded new drivers for Bluetooth USB Module and Intel(r) HD Graphics 4000. In addition, w / my free all search app, pulled up to Windows.old and renamed Anything.old (read on a forum that helped rename Windows.old with any word to replace the word "Windows"). Whether updated drivers and/or the name change, the downloaded Windows Media Creator & the birthday. installed update w / no. HARM my computer or any partition, including the partition w / Ubuntu. End

  • Want Firefox to save your tabs for the next time it starts?

    FF 27.0.1 on Linux Mint XFCE 16, up to date.

    I have my preferences set to "show my home page".

    Whenever I close FF with the X in the upper left corner, he gets up and asks me "do you want Firefox to save your tabs for the next time it starts? I check the box to ask next time and have tried both save and exit and just left. When I open the browser again, it seems to randomly decide to open all the tabs I had last time, or sometimes (rarely) just my home page tabs.

    I don't want to open all the tabs I had open, and I don't want the question whenever I have leave FF. I used FF for years with XP, but I am new to Mint.

    Done setting the prefs 'warnon' on the topic: config false page has an effect any?

    • browser.tabs.warnOnClose
    • browser.tabs.warnOnCloseOtherTabs
    • browser.warnOnQuit

    Make sure that you run not Firefox mode full screen (press F11 or Fn + F11 to toggle; Mac: Command + SHIFT + F).

    If you are in full screen view then hover over with the mouse to the top of the screen to facilitate the bar appear Navigation and tab bar.
    Click the expand (in the top right Navigation bar) to exit full screen or right-click on a space empty on a toolbar and select "exit full screen" or press the F11 key.

  • Extract data from files of the NRF

    Hello!

    So, I'm working on a project where I have files of data that are written on 12 channels in a .nrf file.  As the NRF seems to be a pretty unique file format I don't come with a better than DIAdem Software for open data.  I'm looking for a way to take data from each of the channels and enter the values programmatically every x number of data points.  I use Visual Studio, written in c#, using the Library COM DIAdem.

    At this point I wrote a very basic program that uses CmdExecuteSync ("DataFileImport (" "+ file.)") FillName + "')"); to import the .nrf file in DIAdem, but from there, I'm lost.  I tried to export the data using the DataFileSaveSel function, but unfortunately the CSV output ends up being almost a gigabyte in size, which is too big for my needs.  I hope there is a way to perform the operation, that I need in tiara and if so someone could help get me pointed in the right direction.

    Thank you very much in advance for any help.

    Hi Kub,

    I recommend you use the loading capacity reduced by tiara, like this:

    n = 10
    SectionBegin = 1
    SectionEnd = 1000
    Call DataDelAll
    Call DataFileLoadRed (FileDlgName, "", "", "IntervalWidth", N, 1, SectionBegin, SectionEnd)

    This will load every nth value from value 1 to the value 1000.

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • How to get data from excel

    Hello world

    How can I get data from excel inside my program? I'm using labview 8.2. I have tried to find the solution for this but seems that the solutions are not suitable. Can someone help me? Thank you.

    Hi jieah,

    Inside of the attachment nijams don't you see this?

    read_excel_values. LLB

  • Get data from performance CPU with PowerCLI

    Can I use powerCLI to do the following:?

    -Get 2 virtual machines.

    -Get the following metric: "Application (MHz) CPU" for the last week

    -Export data to CSV

    It is indeed a compromise between the statistical data, you want to keep it online and the capacity of storage-performance on your vCenter server.

    For me there is no rule of universal thumb, you will need to find the ideal configuration for your environment and your specific needs.

    In my environment, the works of config 4, 4, 2, 2. Impact on minimum performance and I can get online reports I need.

    Don't forget that you can change the time and frequency of the aggregation jobs that run on the database, you don't have to stick with the default values.

    But be aware of the impact on the data available in each historical interval.

    And there are alternatives, as I mentioned in my answer to another of your son: Re: Getting pics of use with get-stat



Maybe you are looking for

  • different type of terminals of elapsed time of the DAQ assistant

    I connected a digital relay to one of the outputs. I have installation wizard DAQ to operate a valve with the relay. Now, I want to control the valve to drive all... .lets say 20 seconds, until I stop the program. What I need, is to change the State

  • E260 - impossible to use, update or recognize...

    I just bought a refurb E260 V1 and I've had it for 2 days and now I can't make it work. I was initially able to use my Vista laptop to load some MP3s and everything was fine. Then I tried to create a playlist in WMP 11 to load a certain MP3s. apparen

  • DirectX, d3d9.ll & d3d10.dll and Windows Update does not work... (Same problem?)

    I had some problems with my computer lately... The first thing I noticed is that I failed to run games and applications and I got this weird error 'missing d3d9.dll' and something in style with... "it could be fixed if you have reinstalled the applic

  • HP Envy x 2: admin password bios

    Having a problem with the password bios admin. Typed in 3 times, go back to the 8 digit code: 51052608 Any help would be appreciated. thanx

  • How to reset the windows media player 12 default settings

    Original title: how to reset the windows media player 12 default settings My Windows media Player 12 has stopped play all the sounds (Win 7 HP 64 bit) - I can play sounds with Windows media Center, DIVX, etc. of Winamp, but not with Win Media Player.