Query on dates - Thanks

Hello,
I need some help in writing a query. Any suggestions are greatly appreciated.
Below is a table which has start and end_dates for each person's record. Each record of a person should have an end date(except the latest record of every person) which should be one less than the start-date of the next record. Some of the records of the person are missing. I need to write a query to find the records which doesn't have the end date and the expected end date for that record.
Thank you in advance.
KK
PERSON_ID
START_DATE
END_DATE
111
9/1/2005
111
12/1/2004
8/31/2005
111
9/1/2004
111
9/1/2003
8/31/2004
111
12/30/2002
8/31/2003
137
9/1/2012
137
9/1/2011
8/30/2012
137
9/1/2010
8/31/2011
137
9/1/2009
8/31/2010
137
9/1/2008
8/31/2009
137
9/1/2007
8/31/2008
137
9/1/2006
8/31/2007
137
9/1/2005
8/31/2006
137
9/1/2004
8/31/2005
137
10/24/2003
8/31/2004
137
9/1/2003
137
12/30/2002
8/31/2003
148
9/1/2011
148
9/1/2010
8/31/2011
148
9/1/2009
8/31/2010
148
9/1/2008
8/31/2009
148
9/1/2007
8/31/2008
148
9/1/2006
8/31/2007
148
9/1/2005
8/31/2006
148
4/8/2005
8/31/2005
148
9/1/2004
148
9/1/2003
8/31/2004
148
12/30/2002
8/31/2003

sounds like a job for lead, something like:
select t.*
     , lead(start_date) over(partition by person_id order by start_date) - 1 end_date_calculated
  from t
order by start_date;
PERSON_ID START_DATE END_DATE   END_DATE_C
       111 30.12.2002 31.08.2003 31.08.2003
       111 01.09.2003 31.08.2004 31.08.2004
       111 01.09.2004            30.11.2004
       111 01.12.2004 31.08.2005 31.08.2005
       111 01.09.2005
If the column generated with lead is null, then it is the last row for the given person_id.

Similar Messages

  • An error occurred querying a data source - with REST services

    Hi,
    I have a SharePoint 2013 form library library with an info-path form. I need to get the logged in user's 'Display Name' on my form load automatically.
    I used REST service to fetch the current user details. In the preview mode of the form, its showing the right name. But when I publish this form to library I am getting the following error.
    REST Service --> http://site url/_api/SP.UserProfiles.PeopleManager/GetMyProperties
    Please help me to resolve this issue.
    Thanks in advance for your time and reply :)

    Hi,
    According to your post, my understanding is that an error occurred querying a data source with REST services.
    It is defiantly permission issue with GetUserProfileByName service
    and could be many reasons of this problem. You first try with UDCX file and make sure that UPS is running.
    Here are some similar threads for your reference:
    http://social.technet.microsoft.com/Forums/en-US/b8c668ea-7511-4657-a1a8-08fb4a6bd53d/info-path-an-error-occurred-querying-a-data-source?forum=sharepointcustomizationprevious
    http://social.technet.microsoft.com/Forums/en-US/46866ac2-da09-4340-a86a-af72cbb2c8d7/info-path-an-error-occurred-querying-a-data-source-?forum=sharepointcustomization
    http://blogs.msdn.com/b/russmax/archive/2012/08/17/want-to-call-sharepoint-2010-web-services-within-browser-based-infopath-2010-forms.aspx
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Query xml data from a CLOB datatye

    All,
    I read in an oracle white paper that is is possible to query XML data from CLOB datatype using oracle text index using operators HASPATH() and INPATH(). I am not able to find any example on how to do this. Can someone please post a simple example here.
    Thank You very much!

    SCOTT@10gXE> CREATE TABLE your_table (id NUMBER, xml_data CLOB)
      2  /
    Table created.
    SCOTT@10gXE> INSERT INTO your_table (id, xml_data)
      2  SELECT t.deptno,
      3           DBMS_XMLGEN.GETXML
      4             ('SELECT d.dname,
      5                   CURSOR (SELECT e.ename, e.job
      6                        FROM   emp e
      7                        WHERE  e.deptno = d.deptno) emp_data
      8            FROM   dept d
      9            WHERE  d.deptno = ' || t.deptno)
    10  FROM   dept t
    11  /
    5 rows created.
    SCOTT@10gXE> COMMIT
      2  /
    Commit complete.
    SCOTT@10gXE> begin
      2    ctx_ddl.create_section_group('xmlpathgroup', 'PATH_SECTION_GROUP');
      3  end;
      4  /
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> CREATE INDEX myindex
      2  ON your_table(xml_data)
      3  INDEXTYPE IS ctxsys.context
      4  PARAMETERS ('datastore ctxsys.default_datastore
      5              filter ctxsys.null_filter
      6              section group xmlpathgroup'
      7            )
      8  /
    Index created.
    SCOTT@10gXE> SELECT * FROM your_table
      2  WHERE  CONTAINS (xml_data, 'PERSONNEL INPATH (//DNAME)') > 0
      3  /
            ID XML_DATA
            50 <?xml version="1.0"?>
               <ROWSET>
                <ROW>
                 <DNAME>PERSONNEL</DNAME>
                 <EMP_DATA>
                 </EMP_DATA>
                </ROW>
               </ROWSET>
    SCOTT@10gXE> SELECT * FROM your_table
      2  WHERE  CONTAINS (xml_data, 'HASPATH (//DNAME="PERSONNEL")') > 0
      3  /
            ID XML_DATA
            50 <?xml version="1.0"?>
               <ROWSET>
                <ROW>
                 <DNAME>PERSONNEL</DNAME>
                 <EMP_DATA>
                 </EMP_DATA>
                </ROW>
               </ROWSET>
    SCOTT@10gXE> SELECT * FROM your_table
      2  WHERE  CONTAINS (xml_data, 'CLARK INPATH (//ENAME)') > 0
      3  /
            ID XML_DATA
            10 <?xml version="1.0"?>
               <ROWSET>
                <ROW>
                 <DNAME>ACCOUNTING</DNAME>
                 <EMP_DATA>
                  <EMP_DATA_ROW>
                   <ENAME>CLARK</ENAME>
                   <JOB>MANAGER</JOB>
                  </EMP_DATA_ROW>
                  <EMP_DATA_ROW>
                   <ENAME>KING</ENAME>
                   <JOB>PRESIDENT</JOB>
                  </EMP_DATA_ROW>
                  <EMP_DATA_ROW>
                   <ENAME>MILLER</ENAME>
                   <JOB>CLERK</JOB>
                  </EMP_DATA_ROW>
                 </EMP_DATA>
                </ROW>
               </ROWSET>
    SCOTT@10gXE> SELECT * FROM your_table
      2  WHERE  CONTAINS (xml_data, 'HASPATH (//ENAME="CLARK")') > 0
      3  /
            ID XML_DATA
            10 <?xml version="1.0"?>
               <ROWSET>
                <ROW>
                 <DNAME>ACCOUNTING</DNAME>
                 <EMP_DATA>
                  <EMP_DATA_ROW>
                   <ENAME>CLARK</ENAME>
                   <JOB>MANAGER</JOB>
                  </EMP_DATA_ROW>
                  <EMP_DATA_ROW>
                   <ENAME>KING</ENAME>
                   <JOB>PRESIDENT</JOB>
                  </EMP_DATA_ROW>
                  <EMP_DATA_ROW>
                   <ENAME>MILLER</ENAME>
                   <JOB>CLERK</JOB>
                  </EMP_DATA_ROW>
                 </EMP_DATA>
                </ROW>
               </ROWSET>
    SCOTT@10gXE>

  • 5200: Error executing query: The data form grid is invalid.

    Hi,
    I am getting this error " 5200: Error executing query: The data form grid is invalid. Verify that all members selected are in Essbase. Check log for details.
    com.hyperion.planning.HspException;hasPovDims=1;povXML=<?xml version="1.0"?><datasources><datasource name="Profit " dsid="228af2c3_129ca3dd85c_-77b1" allowEdit="1"><dim name="Period" dimIndex="1" dsName="Profit " keyDimName="Period" memberName="Apr" displayName="Period: Apr"/><dim name="Year" dimIndex="2" dsName="Profit " keyDimName="Year" memberName="FY10" displayName="Year: FY10"/><dim name="Entity" dimIndex="5" dsName="Profit " keyDimName="Entity" memberName="9999" displayName="Entity: 9999"/></datasource></datasources>"
    I have checked that both the systems essbase and planning are same. nothing's different. still i cannot find the exact reason why the report is not working.
    can any please help me.
    btw, i am using Hyperion Planning 9.3.1
    Thanks,
    BIMS

    Hi
    You probably deleted some members from outline that are used by report
    I would recommend you to open you report/grid via rep.client and try to find which elements are abcent
    Regards
    Alexander
    Edited by: Softperson on 19/8/2010 17:38

  • Error when querying OLAP data with BI answers

    Have been doing all the Lessons in "Using Oracle OLAP With Oracle BI Enterprise Edition 10g Release 3". Got till lesson 3 where I'm supposed to query the data with Answers but If I add any of the facts to the report, I get the following error:
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17003] Oracle gateway error: Unsupported data type 101. (HY000)
    SQL Issued: SELECT Customer."Ship To" saw_0, Measures.COST saw_1 FROM Global ORDER BY saw_0
    So I was wondering if anyone knows what the catch could be.
    Thanks in advance!

    Yes. Me too. I have the same issue and I don't find any information about it. Could anyone help ?

  • Problem inserting and querying XML data with a recursive XML schema

    Hello,
    I'm facing a problem with querying XML data that is valid against a recursive XML Schema. I have got a table category that stores data as binary XML using Oracle 11g Rel 2 on Windows XP. The XML Schema is the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="bold_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="keyword_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
                   <xs:element name="plain_text" type="xs:string"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="emph_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="text_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="parlist_type">
              <xs:sequence>
                   <xs:element name="listitem" minOccurs="0" maxOccurs="unbounded" type="listitem_type"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="listitem_type">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="parlist" type="parlist_type"/>
                   <xs:element name="text" type="text_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:element name="category">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="name"/>
                        <xs:element name="description">
                                  <xs:complexType>
                                            <xs:choice>
                                                           <xs:element name="text" type="text_type"/>
                                                           <xs:element name="parlist" type="parlist_type"/>
                                            </xs:choice>
                                  </xs:complexType>
                        </xs:element>
                                                                </xs:sequence>
                                                                <xs:attribute name="id"/>
                                            </xs:complexType>
                        </xs:element>
    </xs:schema>I registered this schema and created the category table. Then I inserted a new row using the code below:
    insert into category_a values
    (XMlElement("category",
          xmlattributes('categoryAAA' as "id"),
          xmlforest ('ma categ' as "name"),
          (xmlelement("description", (xmlelement("text", 'find doors blest now whiles favours carriage tailor spacious senses defect threat ope willow please exeunt truest assembly <keyword> staring travels <bold> balthasar parts attach </bold> enshelter two <emph> inconsiderate ways preventions </emph> preventions clasps better affections comes perish </keyword> lucretia permit street full meddle yond general nature whipp <emph> lowness </emph> grievous pedro')))    
    The row is successfully inserted as witnessed by the results of row counting. However, I cannot extract data from the table. First, I tried using SqlPlus* which hangs up and quits after a while. I then tried to use SQL Developer, but haven't got any result. Here follow some examples of queries and their results in SQL Developer:
    Query 1
    select * from category
    Result : the whole row is returned
    Query 2
    select xmlquery('$p/category/description' passing object_value as "p" returning content) from category
    Result: "SYS.XMLTYPE"
    now I tried to fully respect the nested structure of description element in order to extract the text portion of <bold> using this query
    Query 3
    select  xmlquery('$p/category/description/text/keyword/bold/text()' passing object_value as "p" returning content) from  category_a
    Result: null
    and also tried to extract the text portion of element <text> using this query
    Query 4
    select  xmlquery('$p/category/description/text/text()' passing object_value as "p" returning content) from  category_a
    Result: "SYS.XMLTYPE".
    On the other hand, I noticed, from the result of query 1, that the opening tags of elements keyword and bold are encoded as the less than operator "&lt;". This explains why query 3 returns NULL. However, query 4 should display the text content of <text>, which is not the case.
    My questions are about
    1. How to properly insert the XML data while preserving the tags (especially the opening tag).
    2. How to display the data (the text portion of the main Element or of the nested elements).
    The problem about question 1 is that it is quite unfeasible to write a unique insert statement because the structure of <description> is recursive. In other words, if the structure of <description> was not recursive, it would be possible to embed the elements using the xmlelement function during the insertion.
    In fact, I need to insert the content of <description> from a source table (called category_a) into a target table (+category_b+) automatically .
    I filled category_a using the Saxloader utility from an flat XML file that I have generated from a benchmark. The content of <description> is different from one row to another but it is always valid with regards to the XML Schema. The data is properly inserted as witnessed by the "select * from category_a" instruction (500 row inserted). Besides, the opening tags of the nested elements under <description> are preserved (no "&lt;"). Then I wrote a PL/SQL procedure in which a cursor extracts the category id and category name into varchar2 variables and description into an XMLtype variable from category_a. When I try to insert the values into a category_b, I get the follwing error:
    LSX-00213: only 0 occurrences of particle "text", minimum is 1which tells that the <text> element is absent (actually it is present in the source table).
    So, my third question is why are not the tags recognized during the insertion?
    Can anyone help please?

    Hello,
    indded, I was using an old version of Sqlplus* (8.0.60.0.0) because I had a previous installation (oracle 10g XE). Instead, I used the Sqlplus* shipped with the 11g2database (version 11.2.0.1.0). All the queries that I wrote work fine and display the data correctly.
    I also used the XMLSERIALIZE function and can now display the description content in SQL Developer.
    Thank you very much.
    To answer your question Marco, I registered the XML Schema using the following code
    declare
      doc varchar2(4000) := '<?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="bold_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="keyword_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
                   <xs:element name="plain_text" type="xs:string"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="emph_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="text_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="parlist_type">
              <xs:sequence>
                   <xs:element name="listitem" minOccurs="0" maxOccurs="unbounded" type="listitem_type"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="listitem_type">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="parlist" type="parlist_type"/>
                   <xs:element name="text" type="text_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:element name="category">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="name"/>
                        <xs:element name="description">
                                  <xs:complexType>
                                            <xs:choice>
                                                           <xs:element name="text" type="text_type"/>
                                                           <xs:element name="parlist" type="parlist_type"/>
                                            </xs:choice>
                                  </xs:complexType>
                        </xs:element>
                                                                </xs:sequence>
                                                                <xs:attribute name="id"/>
                                            </xs:complexType>
                        </xs:element>
    </xs:schema>';
    begin
      dbms_xmlschema.registerSchema('/xmldb/category_auction.xsd', doc,     LOCAL      => FALSE, 
            GENTYPES   => FALSE,  GENBEAN    => FALSE,   GENTABLES  => FALSE,
             FORCE      => FALSE,
             OPTIONS    => DBMS_XMLSCHEMA.REGISTER_BINARYXML,
             OWNER      => USER);
    end;then, I created the Category table as follows:
    CREATE TABLE category_a of XMLType XMLTYPE store AS BINARY XML
        XMLSCHEMA "xmldb/category_auction.xsd" ELEMENT "category";Now, there still remains a problem of how to insert the "description" content which I serialized as a CLOB data into another table as XML. To this purpose, I wrote a view over the Category_a table as follows:
    CREATE OR REPLACE FORCE VIEW "AUCTION_XWH"."CATEGORY_V" ("CATEGORY_ID", "CNAME", "DESCRIPTION") AS
      select category_v."CATEGORY_ID",category_v."CNAME",
      XMLSerialize(content ( xmlquery('$p/category/description/*' passing object_value as "p" returning content)) as clob) as "DESCRIPTION"
      from  auction.category_a p, 
    xmltable ('$a/category' passing p.Object_Value as "a"
    columns  category_id varchar2(15) path '@id',
              cname varchar2(20) path 'name') category_v;Then, I wrote a procedure to insert data into the Category_xwh table (the source and target tables are slightly different: the common elements are just copied wereas new elements are created in the target table). The code of the procedure is the following:
    create or replace PROCEDURE I_CATEGORY AS
    v_cname VARCHAR2(30);
    v_description clob ;
    v_category_id VARCHAR2(15);
    cursor mycursor is select category_id, cname, description from category_v;
    BEGIN
    open mycursor;
      loop
      /*retrieving the columns*/
      fetch mycursor into v_category_id, v_cname, v_description ;
      exit when mycursor%notfound;
      insert into category_xwh values
      (XMlElement("category",
          xmlattributes(v_category_id as "category_id"),
          xmlelement("Hierarchies", xmlelement("ObjHierarchy", xmlelement ("H_Cat"),
                                                               xmlelement ("Rollsup",
                                                                                  (xmlelement("all_categories",
                                                                                   xmlattributes('allcategories' as "all_category_id")))
        xmlforest (
                  v_cname as "cat_name",
                  v_description as "description")    
    end loop;
      commit;
      close mycursor;
    END I_CATEGORY;When I execute the procedure, I get the following error:
    LSX-00201: contents of "description" should be elements onlyso, I just wonder if this is because v_description is considered as plain text and not as XML text, even if its content is XML. Do I need to use a special function to cast the CLOB as XML?
    Thanks for your help.
    Doulkifli

  • How can I make a query by date with several TDMS files?

    Hi,
    I have a project that can write and read TDMS files everyday (a file for each day with date and time). There, I can import those files to excel (I choose a file and load it). But, I have a question: How can I make a query by date with those TDMS files? I'd like make a time stamp for start date and stop date, where I could compare the TDMS file dates and sum the values that are in the channels where these files are similar. For example, I save a file with "02/01/2013" name, in other day "03/01/2013", in other day "04/01/2013"... so, i'd like put in time stamp for start date "02/01/2013" file and to stop date "04/01/2013" file, than, sum all values that range with my TDMS files existing. How can I make that? 
    Thanks all,
    Val 

    Hello Val_Auto.
    You're Brazilian, no? Me too. = ^ - ^ =
    I converted VI to version of your LabVIEW (8.5). Is attached in this reply.
    This VI search all your TDMS in a range of dates and join them in a single TDMS. I hope this is what you wanted.
    Query TDMS is the main VI. The TDMS VI Search changes the date format that out from calendar control (which is DD / MM / YYYY) to DD-MM-YYYY. This is because you can't name files using "/". I chose "-" but, if necessary, you should change to keep the same format of your TDMS files.
    If you have any doubt as to its operation or how to make changes to adapt VI for your application, keep at your disposal.
    Thank you for your contact; I hope have helped you and succeed in your application.
    Wesley Rocha
    Application Engineer
    National Instruments Brazil
    Visite a nossa comunidade em PORTUGUÊS!!!
    Attachments:
    Query TDMS.vi ‏62 KB
    tdms search.vi ‏24 KB

  • Oracle 10g Query on Date Column

    Hello -
    What is the most efficient way to query on a date column to get all dates within the last 2 months? I use something like the following in the WHERE clause:
    billing_date >= to_date(add_months(sysdate, -2))
    However, I can't ever get the index on billing_date to be used.
    Any help is greatly appreciated...
    Thanks!!

    This is a perfectly valid way to query the data. Here's an example on my own production tables. This one has about 300 million rows:
    select *
    from   prod.tran_history
    where  tran_date >= to_date(add_months(sysdate, -2))
    | Id  | Operation                   |  Name                        | Rows  | Bytes | Cost  |
    |   0 | SELECT STATEMENT            |                              |    11M|   863M|   146K|
    |   1 |  TABLE ACCESS BY INDEX ROWID| TRAN_HISTORY                 |    11M|   863M|   146K|
    |*  2 |   INDEX RANGE SCAN          | TRAN_HIST_DATE_IDX           |  2144K|       |  2098 |
    --------------------------------------------------------------------------------------------

  • " Query regarding Data transfer from Bi to BO Tool "

    Dear Friends,
                       I am having a query. I have  created a Info-cube and established the universe on the top of the Info-cube.The Dat is coming in the Bi system. When I created a new Webi-report the Data from the ino-cube in the universe is not reflecting the Webi-report .
                         Can anyone tell me the solution for the Data Load in the Webi-report .

    Hi,
    There are two ways to design universe on top of cube/Query.
    1)Olap Universe :Please go through by below link for how to create mdx universe.by this way create one connection and select cube or query and by default designer will replicate cube/query in the universe.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/903a7fc7-19e8-2d10-fa95-b050de946b61?quicklink=index&overridelayout=true
    2) Create Data federator project on top of Cube and then design universe.
    To pull data in the webi report create universe then  select objects and run the query.If data is available in the cube or query that will come in the webi report.
    I have already said webi report pull data at run time.there is no need or no way to load data in the universe or webi.
    Design a universe and create  webi or deski report on top of universe.
    For more information you can search on net can be found documents how to create report.
    Hope this helps you.
    Thanks,
    Amit

  • In Query mode, date items does not accepts more than 10 characters..Why?

    Dear All,
    In my form, While querying my date items, it does not accepts more than 10 Characters. Could it be changeable.
    Actually i want to search like greater than specified date( >01/01/2007 ).
    But i can specify like >01/01/07. After tabbing out from that item, it displays like >01/01/200.
    How to overcome this issue.
    Please help.
    Regards,
    Balaji

    You are absoletely correct Francois!
    Previously i have made a mistake that both of my maximum length and query length property to 20. That time it was not worked. Now i changed my maximum length to the old one like 11 and i changed only the query length to 20.
    Now it is working. I understood the concept wrongly.
    Thanks Francois!

  • Can we create range variable for Query Key Date

    Hello Gurus,
    Can we create a range variable for Query Key Date ? when I tried to give a range of values for Query Key Date, I am unable to find Range Values option. I found only Single Values.
    so, Please let me know if we can use Range variables for Query Key Date ??
    Thanks in advance,
    Regards,
    Aarthi

    Hi Aarthi,
    This is relevant for the time dependant master data that is being pulled in thw query. Like if you are using a nav attr in the query and this nav attr is time dependant, then which record (from the char master data) is to be pulled into the report, depends upon the key date that you specify.
    The default key date value is the date on which the query is executed, that is <Today>.
    Hope this helps...

  • Query for data

    Hi all, i am trying to write a query for a specific scenario using analytic functions.
    i have a table that has data in week basis. here is some sample data
    id date value
    1 1/4/10 A
    1 1/11/10 B
    1 1/18/10 C
    2 ....
    2 ....
    each date represent the beginning of the week. i have another table that contains calendar dates that include day of the week excluding weekends and holidays.
    example data
    id date
    1 1/4/10
    1 1/5/10
    1 1/6/10
    1 1/7/10
    1 1/8/10
    1 1/11/10
    1 ...... SO ON
    as you can see 1/1/10, 1/2, 1/3 are not present because they are either holidays or weekends.
    what i want to do is join this two tables by id and the output should be the following
    1 1/4/10 A
    1 1/5/10 A
    1 1/6/10 A
    1 1/7/10 A
    1 1/8/10 A
    1 1/11/10 B
    1 1/12/10 B
    1 1/13/10 B
    1 1/14/10 B
    1 1/15/10 B
    and so on. so as you can see. i am converting the week table (first table) into day basis. i tried to use analytic function but i was not very successful since i am new to them. any help will be appricatiate. provide sample query if possible. thanks a lot

    Hi,
    What if the week crosses over 2 months.
    Fo example March the last week starts on 29 and has 1st apr and 2nd apr in the same week.Would you consider those?
    If not here is one way of doing it.
    with t1 as (
                select 1 id,DATE '2010-03-01' dt,'A' val from dual union all
                select 1,DATE '2010-03-08','B' from dual union all
                select 1,DATE '2010-03-15','C' from dual UNION ALL
                select 1,DATE '2010-03-22','D' from dual    UNION ALL
                select 1,DATE '2010-03-29','E' from dual  
         t2 as (
                select 1 id,DATE '2010-03-01' dt from dual union all
                select 1,DATE '2010-03-02' from dual union all
                select 1,DATE '2010-03-03' from dual union all
                select 1,DATE '2010-03-04' from dual union all
                select 1,DATE '2010-03-05' from dual union all
                select 1,DATE '2010-03-08' from dual union all
                select 1,DATE '2010-03-09' from dual union all
                select 1,DATE '2010-03-10' from dual union all
                select 1,DATE '2010-03-11' from dual union all
                select 1,DATE '2010-03-12' from dual UNION ALL
                select 1,DATE '2010-03-15' from dual UNION ALL
                select 1,DATE '2010-03-16' from dual UNION ALL           
                select 1,DATE '2010-03-17' from dual UNION ALL
                select 1,DATE '2010-03-18' from dual UNION ALL
                select 1,DATE '2010-03-19' from dual UNION ALL
                select 1,DATE '2010-03-22' from dual UNION ALL
                select 1,DATE '2010-03-23' from dual UNION ALL                                               
                select 1,DATE '2010-03-24' from dual UNION ALL                                                           
                select 1,DATE '2010-03-25' from dual UNION ALL                                                           
                select 1,DATE '2010-03-26' from dual UNION ALL                                                         
                select 1,DATE '2010-03-29' from dual UNION ALL
                select 1,DATE '2010-03-30' from dual UNION ALL
                select 1,DATE '2010-03-31' from dual UNION ALL
                select 1,DATE '2010-04-01' from dual UNION ALL  
                select 1,DATE '2010-04-01' from dual                                )
               SELECT DISTINCT a.ID,b.dt,a.val,to_char(b.dt,'IW') FROM t1 a,t2 b WHERE a.ID=b.ID
               AND to_char(a.dt,'MON')=to_char(b.dt,'MON')
               AND to_char(a.dt,'IW')=to_char(b.dt,'IW')
               ORDER BY val,dtCheers!!!
    Bhushan

  • Can't query sql data

    I'm connecting fine to a SQL DB. Used the "help" sample in LS 8.0 help to enter an ID that should query the data for a specific data set. Using "click" and "FormCalc", I get an error. This is my code:
    //Change the commandType from TABLE to TEXT. TEXT
    //is the equivalent of SQL Property
    $sourceSet.DataConnection.#command.query.commandType = numeric
    //Set the Select Node. Select in this case will be
    //whatever SQL Property you want
    $sourceSet.DataConnection.#command.query.select.nodes.item(0).value = Concat(Select*from licenses Where userid = , ListBox1.rawValue,)
    //Reopen the Data connection
    $sourceSet.DataConnection.open()
    I've tried the Javascript version of this, and I get no error, but nothing at all happens.
    Help??

    - Help | About | Version:
    Java(TM) Platform     1.6.0_14
    Oracle IDE     3.1.07.42
    Versioning Support     3.1.07.42
    - Help | About | Properties:
    java.home     C:\Program Files\Java\jdk1.6.0_14\jre
    jdbc.driver.home     /C:/ORACLE/product/10.2.0/client_1/
    jdbc.library     /C:/ORACLE/product/10.2.0/client_1/jdbc/lib/ojdbc6.jar
    - running <sqldevelope>\sqldeveloper\bin\sqldeveloper.exe:
    popup blank console but no msg. in it.
    Thanks for the tips! Yesterday I configured apache tomcat and copied ojdbc into it's
    library, maybe copy wrong folder at that time. I just removed ojdbc6 and keep ojdbc14
    in oracle jdbc library. After it, now the sql developer can start successfully!
    Many thanks!

  • APD query key date with variable for time dependent MD display attributes

    Hello,
    In a APD I use a query as a source with a query key date that is filled with a customer exit variable.
    When I run the query as a user, the time dependent MD display attributes look fine. However, when I use the query in an APD, I get no values for the time dependent display attributes.
    Any suggestions?
    Thanks

    Hi,
    Try to run query using RSCRM_BAPI Tcode, this you can also schedule in background
    Thanks
    Reddy

  • Querying a date field with different masks in form and database

    Dear friends,
    I have a field with date format mask dd/mm/yyyy hh24:mi:ss, but the same field has date format dd/mm/yyyy inside the form which queries it.
    If I run this form, obviously I will query this date in dd/mm/yyyy format mask, but this date is not being found because it doesn't include hh24:mi:ss (hour) from the database field.
    How can I solve this problem? I tried to change my form, putting a format mask with hours, but it requires me to query this date with time, and obviously no one needs to know the exact moment (with seconds!) when the date was recorded in the database.
    Thanks, and best regards,
    Franklin

    Franklin,
    You could instruct your users to use the '%' when they enter a date search criteria. Another alternative would be to programatically add the '%' to the date. Also, if your Block based on a view you could alter the vuew to use TRUNC() on the date field to drop the time.
    Another option would be to use the Pre-Query trigger to modify the Block WHERE clause to: TRUNC(date_field) = :block.date_field.
    Hope this helps.
    Craig...
    -- If my response or the response of another is helpful or answers your question, please mark the response accordingly. Thanks!

Maybe you are looking for

  • I signed up for a free trial.  I want to convert a Word document to a PDF document.  I've signed in and been through the process a dozen times.  It doesn't work.

    I signed up for a free trial.  I want to convert a Word document to a PDF document.  I've signed in and been through the process a dozen times.  It doesn't work.

  • Hii Inbound idoc status

    Hii i have a requirement where when an Zidoc is being process if a certain condition is met we should insert in a custom table and not process the IDOC What status should i put the IDOC in a sort of stand by process so that the user can process it la

  • Doubt in block list display

    hi all, in my object i have displayed the output using alv block list ... when i print that one i am geting each block in seperate page ... but i need to print all in a single page ... please help me out in solving this thanks in advance lokesh

  • Small Caps Problem

    I use Helvetica Neue, and have for the last 4 years. Recently, whenever I change lower case type to small caps, funky looking characters show up. If I export to a PDF, the small caps are fine. What's happening?

  • Populating extended fields

    Hello Guys, iam migrating Open AR Line Items using idoc ctracdocument_create .i extend 2 fields of dfkkop and i also extended the idoc according to the requirement,now i need to populate the 2 extended fields using user exit fkya002.can anybody help