Generate linear dates betwen two dates

Hi,
There are two dates as input. need to generate series of dates between those dates. Dates must appear in column wise
please suggest how to write the query on that.
Eg: If we enter two dates as start date 1-JAN-2011 and end date as 5-JAN-2010
It must generate a linear date as 1-JAN-2011 2-JAN-2011 3-JAN-2011 4-JAN-2011 5-JAN-2011
date must appear as column wise. P|lease let me know
Thanks
Sudhir

SQL> -- generating sample data:
SQL> with t as (
  2  select to_date('1-JAN-2011', 'dd-mon-yyyy') start_date
  3  ,      to_date('5-JAN-2011', 'dd-mon-yyyy') end_date
  4  from   dual
  5  )
  6  --
  7  -- actual query:
  8  --
  9  select max(decode(max(lvl), 1, dt)) dt1
10  ,      max(decode(max(lvl), 2, dt)) dt2
11  ,      max(decode(max(lvl), 3, dt)) dt3
12  ,      max(decode(max(lvl), 4, dt)) dt4
13  ,      max(decode(max(lvl), 5, dt)) dt5
14  from ( select start_date+level-1 dt
15         ,      level lvl
16         from   t
17         connect by level <= end_date-start_date+1
18       )
19  group by dt;
DT1                 DT2                 DT3                 DT4                 DT5
01-01-2011 00:00:00 02-01-2011 00:00:00 03-01-2011 00:00:00 04-01-2011 00:00:00 05-01-2011 00:00:00
1 row selected.
SQL> -- generating sample data:
SQL> with t as (
  2  select to_date('1-JAN-2011', 'dd-mon-yyyy') start_date
  3  ,      to_date('5-JAN-2011', 'dd-mon-yyyy') end_date
  4  from   dual
  5  )
  6  --
  7  -- actual query:
  8  --
  9  select max(decode(max(lvl), 1, dt)) dt1
10  ,      max(decode(max(lvl), 2, dt)) dt2
11  ,      max(decode(max(lvl), 3, dt)) dt3
12  ,      max(decode(max(lvl), 4, dt)) dt4
13  ,      max(decode(max(lvl), 5, dt)) dt5
14  from ( select start_date+level-1 dt
15         ,      level lvl
16         from   t
17         connect by level <= end_date-start_date+1
18       )
19  where to_char(dt, 'dy', 'nls_date_language=american') not in ('sat', 'sun')
20  group by dt;
DT1                 DT2                 DT3                 DT4                 DT5
                                        03-01-2011 00:00:00 04-01-2011 00:00:00 05-01-2011 00:00:00
1 row selected.

Similar Messages

  • What are the steps to turn on "Linear data" in IL02 transaction?

    Hello all
    I'm trying to start using linear asset management for functional locations, however I do not know how to turn on linear data fields in IL02. I only have an empty screen.
    This is what I did:
    1. I have ECC in 606
    2. I created the Organizational Area
    3. I created a class and two characteristics.
    4. Assigned the organizational area to the class and the characteristics
    5. Added values in "Define Organizational Area for Characteristics with Linear Data"
    6. Assigned the class to the functional location (I'm not sure if this is neccesary)
    I do not know what else is needed; any suggestion is more than welcome
    Javier

    You want to change your username. First, make a backup of your files with Time Machine, as any error may damage your user.
    Then, follow these steps to change your username > http://support.apple.com/kb/ht1428 Be very careful, as it requires to log in as root

  • Issues while generating Schema DAT files

    We are facing two type of issues when generating Schema ".dat" files from Informix Database on Solaris OS using the
    "IDS9_DSML_SCRIPT.sh " file.
    We are executing the command on SOLARIS pormpt as follows..
    "IDS9_DSML_SCRIPT.sh <DBName> <DB Server Name> ".
    The first issue is ,after the command is excuted ,while generating the ".dat" files the following error is occuring .This error is occuring for many tables
    19834: Error in unload due to invalid data : row number 1.
    Error in line 1
    Near character position 54
    Database closed.
    This happens randomly for some schemas .So we again shift the script to a different folder in Unix and execute it.
    Can we get the solution for avoiding this error.
    2. The second issue is as follows..
    When the ".dat" files are generated without any errors using the script ,these .dat files are provided to the OMWB tool to load the Source Model.
    The issue here is sometimes OMWB is not able to complete the process of creating the Source Model from the .dat files and gets stuck.
    Sometimes the tables are loaded ,but with wrong names.
    For example the Dat files is having the table name as s/ysmenus for the sysmenus table name.
    and when loaded to oracle the table is created with the name s_ysmenus.
    Based on the analysis and understanding this error is occuring due to the "Delimiter".
    For example this is the snippet from a .dat file generated from the IDS9_DSML_SCRIPT.sh script.The table name sysprocauthy is generated as s\ysprocauthy.
    In Oracle this table is created with the name s_ysprocauthy.
    s\ysprocauthy║yinformixy║y4194387y║y19y║y69y║y4y║y2y║y0y║y2005-03-31y║y65537y║yT
    y║yRy║yy║y16y║y16y║y0y║yy║yy║y╤y
    Thanks & Regards
    Ramanathan KrishnaMurthy

    Hello Rajesh,
    Thanks for your prompt reply. Please find my findings below:
    *) Have there been any changes in the extractor logic causing it to fail before the write out to file, since the last time you executed it successfully? - I am executing only the standard extractors out of the extractor kit so assumbly this shouldnt be a issue.
    *) Can this be an issue with changed authorizations? - I will check this today, bt again this does not seem to be possible as the same object for a different test project i created executed fine and a file was created.
    *) Has the export folder been locked or write protected at the OS level? Have the network settings (if its a virtual directory) changed? - Does not seem so because of the above reason.
    I will do some analysis today and revert back for your help.
    Regards
    Gundeep

  • Using Digital I/O to generate serial data stream

    Hello All,
    I am in need to generate a serial data stream. HW I use is MIO-16E-10.
    I am planning to use the digital line out to generate the serial data stream.
    I seems that if I use the wait timer the minimum pulse width I can get is
    1ms. But for my application the pulses have to be shorter than that. I was
    wondering about an alternative way to achive this. Any one who has worked
    with a similar application please help!
    Thanks in advance!
    Anand.

    Anand,
    What you are looking to do is not possible with the digital lines on the board you have.
    Depending on what other connections you have on the board, you could use one of the two analog outputs to generate your required serial data stream using pattern generation. Check the DAQ solution wizard=>Custom DAQ applications=>Analog Output=>Generate continuous sine wave. This example should give you a baseline to get started. Substitute the sine wave generator for your desired digital stream Logic 0 =0V, Logic 1=5V.
    If you need more than 2 lines, or some form of handshaking, I would suggest using the PCI-6534 or (DIO-32-HS as it was previously called) This will give you the ability to generate serial data streams with timing and/or handshaking.

  • Error 7 occurred when generating the data transfer program

    Hello All ,
    In Master Data Load Process Chain ,  we get error like
    1. System Response
        Caller 09 contains an error message.
    Diagnosis
    Error 7 occurred when generating the data transfer program for the requested InfoSource.
    System Response
    The data transfer is terminated.
    Procedure
    Check the SAP Support Portal for the appropriate Notes and create a customer message if necessary.
    Note : We faced this issue for two days now . Just repeating the load make it success .
    If any one faced and fixed this issue . Please let me know .
    Thanks in advance .

    Hi,
    . Initially goto transaction SE38, Run the program RSDS_DATASOURCE_ACTIVATE_ALL. Give your Datasource name, and source system and check the check box for "Only Inactive objects".
    This will actiavate the given datasource.
    2. Replicate the datasource in RSA1.
    3. Try to schedule the infopackage for the datasource which you have activated now.
    4. IF infopackage runs through, Repeat the process for all datasources ie uncheck the check box, which means it will activate all datasources for the source system.
    Also make sure that there will be enough Back Ground Processor available....
    Reduce the parallel process
    Thanks
    BVR

  • Deleting extra layers generated by data-driven graphics?

    I have about 1600 PSD files that I generated using data-driven graphics. They each contain one pixel layer and eleven text layers.
    The number of text layers with actual content varies. My original set of data looked something like the following in Excel:
    001.jpg     A     B     C
    002.jpg     A     D     E     F
    003.jpg     B     G
    004.jpg     A     C     G     H     I     J     K
    005.jpg     F     L     M
    And so on. All files have content in at least two text layers, some have all eleven with content.
    I discovered right away that Photoshop would not import a data set with blank fields for some text layers, there must be actual text for each text variable. So my Excel VBA script (where I combined spreadsheets to create my data set file) added a period to each otherwise empty cell.
    This made my data set look like:
    001.jpg     A     B     C     .     .     .     .
    002.jpg     A     D     E     F     .     .     .
    003.jpg     B     G     .     .     .     .     .
    004.jpg     A     C     G     H     I     J     K
    005.jpg     F     L     M     .     .     .     .
    Photoshop was then happy, imported the data set, and created a folder full of graphics. However, I'm now left with a bunch of files that have a bunch of dots on them. I'm looking for a way (script or macro?) to delete these extra text layers.
    Ideally this script could batch process a folder full of files, parsing each text layer and deleting the ones with just a period character.
    I'm also fine with regenerating the files if there is a way to not create the unneeded text layers in the first place. I thought about using a visibility variable but the layers would still be there, just hidden. I'm not sure how much that helps me.
    I'm a Mac guy but stuck using Windows 7 Pro at work. I have the latest version of Photoshop CC, and some experience with C-like programming languages, so I can handle simple VB or JavaScript hacking if needed.
    Any ideas or suggestions or sample code? TIA for the help.

    Well since nobody had ideas, I spent some time with the PS scripting documentation. I was also able to find a sample script linked from John Nack's blog to start with. This is actually pretty simple, although switching back and forth from VB to JS is a pain (= in VB, == in JS as an example.)
    Presumably this could test for different conditions such as font, or could use a regular expression to find specific text.
    main();
    function main() {
        if ( app.documents.length > 0 )
        removeExtraTextLayers(app.activeDocument);
    //start at index (length-1) to avoid background layer, top layer is index 0
    function removeExtraTextLayers(obj){
            for( var i = obj.artLayers.length-1; 0 <= i; i--) {
            try {
            if (obj.artLayers[i].kind == LayerKind.TEXT && obj.artLayers[i].textItem.contents == ".")
                obj.artLayers[i].remove();
            catch (e) {

  • Unable to generate "Export data source" for Master data infoobject

    Hi Gurus,
    I'm in BW 3.5
    I need to generate "Export data source" for a master data info object.
    I followed below steps:
        I ticked the checkbox "Characterist. is export data source" in the master data Info object maintenance screen.
        In the Infosource area, for the desired Infoobject --> Right click --> Generate export datasource --> a dialog box displays saying "The generation of DataSource  was successful"
    Problem:
    Even after refreshing, etc.. I couldn't find the generated datasource 8**** for the above master data. I also tried to replicate the datasource from the myself source system, but couldn't find it even there. I don't know where the generated export data source is hiding ???
    Could anyone please help ????
    Thanks,
    Venkat

    Hi Venkat,
    I guess that after creating an export datasource for infoobject this DS should appear in the RSA1-Source systems - MYSELF - datasource overview (with name starting with 8). Since it's a datamart, it should appear also as system generated infosource. And in this case you would be able to assign in URs of data target the appropriate infosource (make sure that in Infoproviders tab of RSA1 you have inserted your infoobject as a data target).
    However, there are some bugs related to export data source. CHeck if you see you export data source in RSA6.
    If you don't see it - consider applying OSS Note #816892 - "30BSP26: Export DS for master data is not generated".
    Note #876845 - "30BSP29: InfoObject change: Export DataSource not adjusted" is also may be useful.
    -Vikram

  • Giving Error while generating the Data mart to Infocube.

    Hi Gurus,
    I need to  extract the APO infocube data in to the BW infocube. For that iam trying to generate the data mart to APO infocube .
    So, that i can use that data mart as a data source to extract that APO Infocube data in to  BW infocube.
    In that process iam trying to generate the datamart for APO Infocube . But while generating it is giving errors like below:
    Creation of InfoSource 8ZEXTFCST for target system BW 1.2 failed
    The InfoCube cannot be used as a data mart for a BW 1.2 target system.
    Failed to create InfoSource &v1& for target system BW 1.2.
    PLease suggest me what to do for this Error problem.
    Thanks alot in Advance.

    Hi,
    Point No : 1
    What is Planning Area :
    http://help.sap.com/saphelp_scm41/helpdata/en/70/1b7539d6d1c93be10000000a114084/content.htm
    Point No : 2
    Creation Steps for Planning Area :
    http://www.sap-img.com/apo/creation-of-planning-area-in-apo.htm
    Note : We will not create Planning Area.This will be done by APO team.
    Point No 3  : Afetr opening the T-Code : /n/SAPAPO/MSDP_ADMIN in APO you will be able to see all the planning areas.
    Point No 4 : Select your planning area and Goto Extras menu and Click on Generate DS
    Point No 5. System automaticall generate the DS in APO (Naming Convention start with 9) and Replicate the DS in BI Map to your cube and load the data.
    Regards
    Ram.

  • BIP Trial 11.1.1..6: Error while generating XML data in Data Model

    Hello,
    I have created a Data Model with a single query. After saving the DM and clicking on the XML icon to generate sample data, I get the following error:
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    End tag 'span' does not match the start tag 'img'. Error processing resource 'http://localhost:7001/xmlpserver/servlet/xdo'...
    *<table style='background=color: #d9e5ef; margin-top: 10px;' width='100%' cellspacing='0' cellpadding='0' border='0' summa...*
    I have verified that the SQL runs without errors in SQL Developer using the same connection parameters as whats used in the DM.
    There are no html tags/key-words etc being used in the sql our it's output.
    Is there a a way to debug this? This is extremely frustrating. Especially since the same sql works without any issues in Oracle Reports.
    Thanks,
    Manish

    ya i can understand we wont do the sql logic at the data model part as some time performance issue may come when comparaed to sql run in package and sql running in data model . so i have mostly done using package and i will just do select * from table in the data set of data model so i didn't face any issue's like this .
    once check this tutorial may be you already
    i use to create parameters like this i didn't face any issue
    SELECT * from TEST where ID=:p_id
    http://st-curriculum.oracle.com/obe/fmw/bi/bip/bip11g/gettingstarted/gettingstarted.htm

  • Need urgent help to generate SPL Data Sources for Line Items

    Hi All,
    I am trying to extract the Special Purpose Ledger Data from R/3 into BW. To do this, I am following the steps to generate the Data Sources for Totals table and Lien Items Table.
    Using Transaction BW01 and BW03 on the R/3 side, I am able to generate the Totals Record-DataSource   successfully.
    But I am not able to generate the Line Items-DataSource. I am using the same procedure.
    Can someone please help me or point me in the right direction. Are there any other settings I need to make to generate the Line Items-DataSource. Interestingly, I am able to generate the Line Items-DataSource  for some other old ledgers in the System like ZZ and ZX. But I need the Line Items-DataSource  from a ledger called ZP for which I am having trouble.
    I would greatly appreciate if someone can get back to me ASAP.

    During BW01, The Generate extract structure is fine for both Total and Line Item Table.The issue is when we run tcode bw03 where you assign the datasource to a ledger.
    Here, I can assign only for the Total Records data source and NOT for the Line Items-DataSource.
    I hope I could explain the issue. Looking forward for some advice.

  • How can I generate a data merge that includes a barcode from excel spreadsheet to InDesign?

    Can you please advise if the following process is possible within InDesign CS 5.5? (Mac OS 10.8.2).
    We need to create a data merge that includes a barcode. The data merge is for several thousand records.
    We have a customer-supplied Excel spreadsheet that contains seven fields, one of which is a number that ultimately needs to print as a barcode when we make the data merge in InDesign.
    As you would expect, the conventional six fields data merge perfectly - but we can't find a way to make the barcode print correctly within the data merge.
    We have investigated several possible solutions without success.
    Some solutions suggest a plug-in for Excel to convert the number into a barcode whilst still in the spreadsheet - but this doesn't come across correctly when we import the CSV file into the InDesign data merge.
    We have investigated certain third party software applications but none provide the full solution we require. Some, for example, appear to create the barcode within the Excel spreadsheet but don't produce the barcode correctly when we data merge in InDesign; and some will allow us to create a one-off barcode within InDesign but have no automated way of retrieving the thousands of Excel numbers and turning them into barcodes.
    We have also come across possible 'font' solutions but have had no success with these either.
    For a previous job we needed to produce we outsourced to a specialist mailing company, who assured us they produced the whole job (very quickly) within InDesign. They, understandably, won't tell us how they did it. But, given the speed with which they produced the job for us, we imagine - with the correct software - the whole process is easy to do.
    Can you please advise?

    See second posting atHow do I generate a data merge in InDesign from an excel spreadsheet which includes a barcode

  • How  to Generate the Dates of Billing Plan Contract

    Dear experts,
    Need your advice on this.
    I have a requirement to create a program to update the Billing Plan of contract. It will run in background and update the end date (billing plan), then generate the dates ( Settlement Date for Deadline, Billing date for billing index and printout, etc ..).
    I have managed to change to end date using 'BILLING_SCHEDULE_READ' and 'BILLING_SCHEDULE_SAVE', but I couldn't generate the dates. I've searched sdn and still, no luck. I've tried 'SD_SALES_BILLINGPLAN_CHANGE' with no result. I've also found 'RV_SALES_DOCUMENT_UPDATE', but I dunno how to fill-in all the parameters.
    Please help .. I have run out of ideas ...
    Thx..
    TRI

    Found the answer .. using BDC :).
    Thx for attention ..
    TRI..

  • Check Data Values, Generates Navigation Data steps taking more time

    Hi,
    In the Masterdata load to 0MAT_PLANT
    The step - "Updating attributes for InfoObject 0MAT_PLANT" used to take a Maximum if 23 minutes for a data package size of 100,000 records till three days ago with the constituent steps "Check Data Values","Process Time-Independent Attributes" and "Generates Navigation Data" taking 5,4 and 12 minutes respectively.
    For the last three days the step "Updating attributes for InfoObject 0MAT_PLANT" is taking 58-60 minutes for the same for data package size of 100,000 records with the constituent steps "Check Data Values","Process Time-Independent Attributes" and "Generates Navigation Data" taking 12,14 and 22 minutes respectively.
    Can anyone please explain what is needed to speeden the dataload back to its previous timing e.g. if  tables indexes need to built for 'P' or 'SID' table of Mat_plant.
    An explanation of why the delay could be happening in the above steps will be really great.
    regards,
    Kulmohan

    Hi Kulmohan Singh,
    I think there may be a difference between the first update and second update is the 100,000 records is
    already in your 0MAT_PLANT.
    If you update the 0MAT_PLANT in twice, The Modify statement should loop the Q table of
    0MAT_PLANT that was already have the 100,000 records in it,so the upload speed was slowly.
    Hope it helpful you.
    Regards,
    James.

  • Generating a data channel in Diadem 6.0

    I would like to generate a data channel to represent a x/y curve. e.g.:
    x: 0.1/0.2/0.3/0.5/0.9
    y: 1/3/10/11.5/15
    How can i do this and how can i use these datas in different autosequences?
    The next question is: how can i control with these datas an analog output?

    Hi,
    If the values you would like to generate are equidistant or can be build with a mathematical algorithm you can use a lot of different DIAdem functions like CHNGENVAL, CHNSPLINEXYCALC, CHNMAPLINCALC etc.. But in your case I can't see something like this, so you must set each value in the channel (see example below)
    ChnAlloc('TestChannel', 5);
    chd(1, 'TestChannel') := 0.3;
    chd(2, 'TestChannel') := 1.2;
    chd(3, 'TestChannel') := 2.8;
    chd(4, 'TestChannel') := 3.3;
    chd(5, 'TestChannel') := 3.7;
    To use this in different Autosequences store it as a separate file and call it with the command AutoInclude.
    With the Block DAC->Simulation inputs->Channels you can read any DIAdem channel and use it to set the output values.
    I hope this will help you a little b
    it.
    Greetings
    Walter

  • Error when generating master data routines

    Hello all,
    I´m trying to activate 0BPARTNER but an error appears: Error when generating master data routines, and no more information is provided.
    I´m working with BW 7.0.
    Has anybody had this problem?
    How could I solve it?
    Thanks in advance.
    Carmen

    Hi Carmen,
    I'm working with SAP BW 700 and I had also this error during a characteristic activation in my QA system. This happened when I tried to transport the activated characteristic from my DEV system.
    I found  also message TK425 when I was trying activation through RSDG_IOBJ_ACTIVATE program.
    I solved this error message with OSS note 01458319 700SP24: "Transport fails during the impact analysis of DTP".-
    I hope this helps.
    Best Regards.
    AW

Maybe you are looking for