Split dates into date range windows

Hi,
I have a peculiar requirement to create windows for different dates.
For example I have two date ranges (two rows in the table column
Start Date End Date
01-Jan 28-Feb
15-Jan 14-Feb (this starts between the previous date range i.e. 01-Jan to 28-Feb)
I have to split dates in a way so that it creates different windows with start and end date i.e.
Start Date End Date
01-Jan 15-Jan (15Jan because it comes before 28 Feb)
16-Jan 14-Feb ( 14Feb as it comes before 28 Feb)
15-Feb 28-Feb
Is there any sql function which can be used to achieve this? or any help you can provide? Thanks.
-Salman

Welcome to the forum!
Unfortunately you posted to the wrong forum. This forum is for sql developer only.
Repost you question in the SQL and PL/SQL forum and you will get help there.
Please mark this question ANSWERED to people will follow up in the other forum.

Similar Messages

  • HT201406 1st. Gen iPad question:  the touch keyboard does not appear when attempting to input data into data fields - this happens while using all apps, ex. Notes, Google, Pages, etc..

    1st. Gen iPad question:  the touch keyboard does not appear when attempting to input data into data fields - this happens while using all apps, ex. Notes, Google, Pages, etc.. The cursor prompt is present.  Tapping screen just brings up the option to: "Select   Select All   Paste."   I have rebbooted with no change. 
    Message was edited by: Jimfromutah
    The problem was my connected bluetooth keyboard.

    1st. Gen iPad question:  the touch keyboard does not appear when attempting to input data into data fields - this happens while using all apps, ex. Notes, Google, Pages, etc.. The cursor prompt is present.  Tapping screen just brings up the option to: "Select   Select All   Paste."   I have rebbooted with no change. 
    Message was edited by: Jimfromutah
    The problem was my connected bluetooth keyboard.

  • WHAT IS PROCEDURE TO UPDATE DATA INTO DATA TARGETS?

    Hi,
    Experts,
    WHAT IS PROCEDURE TO UPDATE DATA INTO DATA TARGETS?
    FULL and DELTA.
    Thnx&regds,
    prerna

    Hi...........
    For both BW 3.X and BI 7.0........replicate the datasource in the BW side and activate it.............if require create Generic datasource and replicate it........
    In BW 3.X.....
    1) Create infosource
    2) Create transfer rules and update rules
    3) Create an infopackage...............with update mode full update( Update tab),in the Processing tab you can make it PSA and then into data targets........only data targets..........or PSA and data targets parallely...............
    For Delta load..........1),2) is same...........
    3) then you have to create a full Upload IP...........and you have to run it first..........
    4) Then you have run a init IP without data transfer to det the init flag
    5) then run Delta IP........
    Init and delta upload will be always without selection......
    BI 7.0 :
    1) Create an infopackage and load data till PSA..............
    2) create transformation between PSA and data targets.....
    3) The create a DTP and load data to the target.............depending on your requirements you DTP can be full or delta..........
    Check the following links :
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/02c52ce87e2c9ce10000000a1553f6/frameset.htm
    http://help.sap.com/search/highlightContent.jsp
    http://help.sap.com/search/highlightContent.jsp
    http://help.sap.com/saphelp_nw70/helpdata/EN/b9/2d9778476b11d4b2b40050da4c74dc/frameset.htm
    Hope this helps you......
    Regards,
    Debjani..........
    Edited by: Debjani  Mukherjee on Sep 14, 2008 1:43 PM

  • How to update DSO data in Data targets (ODS data into Data Targets)

    Hi,
    In 3.5 version we have a option <b>Update ODS data in Data Targets</b>
    to Transfer Data From ODS to Info cube.
    In 7.0 How to transfer DataStore Object data to Info Cube, I can't find
    Update DSO data in Data Target option.
    can any body Help me to solve this problem.
    Thanks
    prasanna

    Hi prassna,
    0RECORDMODE are auto generated infoobjects which are requried to be mapped if you are going for a delta update  from your DSO otherwise you can proceed further without mapping the 0RECORDMODE and neglect the system generated warning
    check this for the <b>Creation of data targets</b>
    •     In left panel select info provider
    •     Select created info area and right click to create ODS( Data store object ) or Cube.
    •     Specify name fro the ODS or cube and click create
    •     From the template window select the required characteristics and key figures and drag and drop it into the DATA FIELD and KEY FIELDS
    •     Click Activate.
    •     Right click on ODS or Cube and select create transformation.
    •     In source of transformation , select object type( data  source) and specify its name and source system Note: Source system will be a temporary folder or package into which data is getting stored
    •     Activate created transformation
    •     Create Data transfer process (DTP) by right clicking the master data attributes
    •     In extraction tab specify extraction mode ( full)
    •     In update tab specify error handling ( request green)
    •     Activate DTP and in execute tab click execute button to load data in data targets.
    cheers
    Sunil

  • How to put a String(date) into Date (java.util.date)??

    hi there
    I got a GUI here and I need to read some JMaskedTextFields from it. I put them all into Strings. Now I need to pass them to the search-function, but one of the search arguments is not string. Its Date. I tried to initialize Date with Date(String s) but he doesnt take it. Now Im asking how can I do this the easiest way?
    The String has only digits and a . betwenn them, like this: 12.02.1978 and I want to pass this into the Date.
    thx for helping :-)

    thx
    Now I got it so far, it looks like this:
    String datumVon = suchen_kriterien_datVon_JMaTextFeld.getText();
    String datumBis = suchen_kriterien_datBis_JMaTextFeld.getText();
    SimpleDateFormat formatter = new SimpleDateFormat ("dd.MM.yyyy");
    ParsePosition pos = new ParsePosition(0);
    Date datVon = formatter.parse(datumVon, pos);
    Date datBis = formatter.parse(datumBis, pos);
    System.out.println(datVon);
    System.out.println(datBis);
    The Problem is that he only makes the first print when both dates are given. If I only give him the first, so he prints the first. If I give him only the scond, so he prints the second. But when I give him both, he only prints the first!!! why?

  • Convert data into Date Format imported from MS SQL Server.

    I have imported Data from MS SQL Server. The "Date Column" received in number format like 41017.6361109954. How can i convert it into Date in Oracle SQL.
    If i import same Data in Excel and change the Column Type to Date. It changes successfully. But in Oracle, I tried To_Date function with different parameters but it didn't work.
    Edited by: XAVER on Apr 22, 2012 2:31 AM

    XAVER wrote:
    The actual date for 41017.6361109954 is 22-Apr-2012 but its showing 20-APR-2082It looks like offset is January 1, 2000:
    select timestamp '2000-01-01 00:00:00' + numtodsinterval(41017.6361109954,'day') from dual;
    20-APR-12 03.15.59.990002560 PM
    SQL> SY.

  • Issue inserting UTF8 data into Oracle in windows environment.

    I have a UTF8 PHP application that is writing a string containing special characters to oracle through a ODBC connection. The Oracle database is setup for UTF8 support.
    Here is the issue. I have a simple string, "louis de funès". When the data manually moved correctly in UTF8 the data comes up correctly. The Oracle dump() shows:
    WORKING DATA:
    String: louis de funès
    select keywords, dump(keywords, 17) from ame_links where keywords like '%louis de %';
    Typ=1 Len=15: l,o,u,i,s, ,d,e, ,f,u,n,c3,a8,s
    However, when the same string is Inserted through the PHP application the data shows up in the db like this.
    NOT - WORKING:
    String: louis de funès
    select keywords, dump(keywords, 17) from ame_links where keywords like '%louis de %';
    Typ=1 Len=17: l,o,u,i,s, ,d,e, ,f,u,n,c3,83,c2,a8,
    (The è character has 4 bytes associated with it)
    Windows Setup:
    Windows Registry: HKEY_LOCAL_MACHINE -> SOFTWARE -> ORACLE -> HOME0 ->
    NLS_LANG=AMERICAN_AMERICA.UTF8
    HTTP headers are set for Content-Type:text/html; charset=UTF-8.
    Anyone know why I would get 2 extra bytes (83,c2) added in the middle of the è character? Is the oracle client doing some other type of character set conversion before I insert it into the database.
    I have also noticed that when I change the NLS_LANG from AMERICAN_AMERICA.UTF8 to AMERICAN_AMERICA.WE8MSWIN1252 that the 4 byte 'è' character works and the 2 byte character doesn't.

    I reproduced the porblem. Only differnce from yours is that it reproduces regardless the NLS_LANG setting.
    Although I cannot be 100% sure, I think what is happening is that Microsoft ODBC Driver Manager converts the insert statement from Windows ACP to Unicode, then calls SQLExecDirectW (WideChar version of SQLExecDirect) of the Oracle ODBC Driver and passes the insert statement in Unicode. Since your PHP code passed the insert statement in UTF-8 encoding, and the Driver Manager converted it from Windows ACP to Unicode, the letter e with grave ("c3,a8" in UTF-8) was wrongly converted to U+00c3, U+00a8 in the Unicode insert statement, then converted to UTF8 ( "c3,83,c2,a8") by Oracle.
    By looking at the PHP source code, apparently PHP odbc_exec() function calls ANSI SQLExecDirect().
    I tried to verify that the Driver Manager calls SQLExecDirectW() of Oracle ODBC Driver by enabling the ODBC Tracing, but I couldn't make it work. It genetates an emply SQL.LOG file. So my investigation stops here.
    IF YOUR METADATA NAMES ARE ASCII ONLY, AND NON-ASCII CHARACTERS APPEAR ONLY IN DATA, you can workaround this problem by binding data. For example,
    $stmt = odbc_prepare($conn, "insert into AME_LINKS (keywords, site_id) values (?, ?)");
    $rs = odbc_execute($stmt, array($invar,77));
    Makoto

  • Crosstab Query re Grouping Data into Value Ranges

    Hi
    I am trying to analyse some data in a Crosstab & have a query re grouping.
    The data contains sales transaction info such as selling price, quantity etc. I would like to create a grouping in the Crosstab based on a sale price range (eg £0 - £10, £10 - £20 etc) so that I can show the total quantity sold in each price range.
    To date my method has been to create a formula with Select Case which identifies each transaction into a price range. I would then use this formula in my Crosstab. The main issue with this method is that there will be a large number of Cases & the possibility this will need to be added to / modified going forward.
    Whilst I think this will work I am hoping there is better method to follow?
    Thanks
    Jon

    Hi Jamie,
    Thank you for your help.
    I'm looking to group in increments of 10 so it looks like the Floor function will do the trick, thank you.
    I'll probably use an If statement to do a "block" of prices at either end of the scale (ie < 100 then 100, > 1000 then 1000+ else Floor ({Sales Field},10). Hopefully this way I'll reduce the overall no of rows.
    Thanks again for your help.
    Jon

  • Problem in getting data into the child window.

    Hi.
    problem description:
    I have a jsp(lets say parent.jsp). On click of a button in parent.jsp, a showmodal dialogue opens(say child.jsp).
    child.jsp has several fields and a 'search' button.
    On click of the 'search' button in child.jsp, data should be fetched from Database and should be populated in child.jsp, without submitting parent.jsp.
    I am able to fetch the data from DB. But unable to populate it in the same child window.
    How to achieve this?
    thanks
    Akash

    areee yaar...ajax and jsp are two different things altogther...whats harm in using ajax if most of the webapplication now deploy ajax for asynchronous call..

  • How do I stop Numbers from changing my data into dates?

    I am trying to create a chart and some of the data ranges from 0-4, 5-9, 10-14, etc...
    When I enter 5-9 on a field, it automatically changes to May 9, 2012. Any help is appreciated.

    Welcome to Apple Support Communities
    In the table where you enter the data, click on the header of the row or column to select the entire range (column B shown selected here).
    Then click the down-arrow button at the right end of the Format buttons and select Numeral System:
    In the Cell Format/Numeral System pop-up, select the options you desire:
    Be sure to begin your entry with the = 'equals' sign if you want the result of the calculation displayed.

  • Populate current date into date field?

    I've been working on trying to get a date field to populate the current date if the user enters ' / ' into the field.  So far I have been able to replace ' / ' with a value but I am not able to populate the current date.  I have tried several suggests that on who to populate current date but have not been able to get my code functioning. 
    I have place the below code on the exit even of the date field which runs correctly but when I try to add in the date it breaks.  Any one have a suggestion?
    if  (this.rawValue == "/")
    this.rawValue = 1
    Thanks

    I have to agree with Radzmar that the workflow is quite odd. That character is a bit unique; however there are 2 ways you can get this to work. One is just to use the code snippet (below) on the Exit event of the text field where the "/" is located or you could use the Action Builder. The Action Builder is a bit easier to understand if your coding knowledge is a bit lacking like myself. Just go to the toolbar at the top, select tools then Action Builder. Each action has a condition and a result. In the condition section select the field which is going to contain the "/", make sure it is set to "is" and then in the box put /. From the result box, select "set the value of a field", select the date field that you wish to have today's date and then it make sure it says "to today's date". Then whenever someone puts "/" into the text field, the date field will populate today's date automatically.
    if (this.resolveNode("$").rawValue == "/") {
      this.resolveNode("DateTimeField1").rawValue = util.printd("yyyy-mm-dd", new Date());

  • Loading  non-english  data into data target

    hi gurus,
    i want to load a flat file. but the flat file data  is in japanese language. can any one help me out in this issue.

    Hi,
    use ALL_CAPITAL in RSKC
    pls. refer for more details...
    Re: How to handle asian characters with RSKC?
    assign points if useful ***
    Thanks,
    Raj

  • How to enter the data into data block text item which has an LOV associated

    Hi,
    I have a data block, one of the data block text item has an LOV assigned. when I populate this text item using the LOV and do "execute_query", it is taking the value in the text item and adding it to the search criteria, but when I enter a value manually in that text item and do "execute_query" it is showing me an alert(which I created) "Please enter a value".
    My question is, why is not taking the value that I enter manually? Looks like before executing the query, this field is getting empty
    How to avoid this problem and make sure that the value entered in the text item is added in the where clause of the query?
    Any advice?
    Thanks in advance
    R.G

    Problem solved!
    Before doing execute-query, all the text items are being cleared,so I used a global variable to store that value
    Thanks anyway
    R.G

  • Pure SQL to partition date-time occurrences into non-overlapping windows?

    i've a question that so far, i've never been able to solve via a pure SQL option.
    it's hard to explain in words, but it's something like this:
    given a set of date-time, i would like to partition the data into non-overlapping windows of 30 minutes each.
    the data is supposed to be partitioned into windows of 30 minutes, meaning when the data is within 30 minutes of the first occurrence, only the first occurrence will be returned. in the next second after the 30th minute, the record will be considered as the start of a new window and is also returned. so those data that occurs within the window period are suppressed. the first occurrence is not necessarily occurring on the 00th minute, so the window start will never be constant.
    run the below query to look at the dummy data.
    SELECT     'A' AS ID
              , TRUNC(SYSDATE) + 7 / 24 + 1 *(ROWNUM - 1) / 1440 AS datetime
          FROM DUAL
    CONNECT BY ROWNUM <= 50
    UNION ALL
    SELECT     'A' AS ID
              , TRUNC(SYSDATE) + 9 / 24 + 8 / 1440 + 1 *(ROWNUM - 1) / 1440 AS datetime
          FROM DUAL
    CONNECT BY ROWNUM <= 35
    UNION ALL
    SELECT     'B' AS ID
              , TRUNC(SYSDATE) + 7 / 24 + 5 *(ROWNUM - 1) / 1440 AS datetime
          FROM DUAL
    CONNECT BY ROWNUM <= 15this is supposed to be the output.
    ID     DATETIME
    A     5/19/2010 07:00:00
    A     5/19/2010 07:30:00
    A     5/19/2010 09:08:00
    A     5/19/2010 09:38:00
    B     5/19/2010 07:00:00
    B     5/19/2010 07:30:00
    B     5/19/2010 08:00:00so far, i'm using a PL/SQL to pipe the records. but i would like to know if this is achievable via SQL or not.
    i've tried looking at analytics, width_bucket, ntile and alll options i can think of, but i just can't solve this at all.

    hey Bob,
    your answer is most definitely correct and does what i want. i've verified it again my data set and it returns the results as required!
    you've definitely proven me wrong. i was always under the impression that this wasn't possible. thanks!
    just a small note:
    i need the windows to be binned by seconds, so have changed the numtodsinterval to raw numbers.
    WITH t AS
         (SELECT 'A' AS ID
                , TRUNC(SYSDATE) +(6.75 / 24) AS datetime
            FROM DUAL
          UNION ALL
          SELECT 'A' AS ID
                , TRUNC(SYSDATE) +(6.75 / 24) AS datetime
            FROM DUAL
          UNION ALL
          SELECT     'A' AS ID
                    , TRUNC(SYSDATE) + 7 / 24 + 1 *(ROWNUM - 1) / 1440 AS datetime
                FROM DUAL
          CONNECT BY ROWNUM <= 50
          UNION ALL
          SELECT     'A' AS ID
                    , TRUNC(SYSDATE) + 9 / 24 + 8 / 1440 + 1 *(ROWNUM - 1) / 1440 AS datetime
                FROM DUAL
          CONNECT BY ROWNUM <= 35
          UNION ALL
          SELECT     'B' AS ID
                    , TRUNC(SYSDATE) + 7 / 24 + 5 *(ROWNUM - 1) / 1440 AS datetime
                FROM DUAL
          CONNECT BY ROWNUM <= 15)
        ,a AS
         (SELECT ID
                ,datetime
                ,LAG(datetime) OVER(PARTITION BY ID ORDER BY datetime) AS prevtime
                ,LAST_VALUE(datetime) OVER(PARTITION BY ID ORDER BY datetime RANGE BETWEEN CURRENT ROW AND 30 / 1440 + 1 / 86400 FOLLOWING) AS interval_end
            FROM t)
        ,b AS
         (SELECT ID
                ,datetime
                ,LEAD(datetime) OVER(PARTITION BY ID ORDER BY datetime) AS nexttime
            FROM t)
        ,ab AS
         (SELECT a.ID
                ,a.datetime
                ,a.prevtime
                   ,a.interval_end
                   ,b.datetime as b_datetime
                ,b.nexttime
            FROM a JOIN b ON(a.ID = b.ID
                             AND a.interval_end = b.datetime)
    SELECT     ID
              ,datetime
          FROM ab
    START WITH prevtime IS NULL
    CONNECT BY ID = PRIOR ID
           AND datetime = PRIOR nexttime
      ORDER BY ID
              ,datetime;this most definitely proves that i'm still not sure of how to use hierarchy queries.
    Edited by: casey on May 20, 2010 11:20 AM

  • How to insert data into table control

    hi experts,,
           i have inserted data into data base table through table control .
    now i want to insert data into table control through database table.
      how to delete data from table control for selected row

    Hi
    go through this link.
    http://www.****************/Tutorials/ABAP/TableControl/Demo.htm

Maybe you are looking for