Comparison of date in PLSQL

Hello

I have a table of data can I search for items in stores. Each element in the array has an associated purchase date and an associate store. How do you suggest wrote a PLSQL script first sorts the data in the table to store, element and date of purchase and then only prints only stores and items with the date of purchase within 3 days of each other. Thanks in advance.

-Cassie

Store: has
-Point: 123
-Purchase Date: January 1, 2011
-Point: 456
-Purchase Date: January 2, 2011

Note that the point: 789 would not be displayed because the purchase date is January 7, 2011

To extend on the excellent example of Frank, you can take advantage of window in the partition and get information on all sales on the same item in the store even within 3 days:

  , COUNT(*) OVER ( PARTITION BY  store, item
                         ORDER BY    purchase_date
                  RANGE BETWEEN INTERVAL '3' DAY PRECEDING
                            AND INTERVAL '3' DAY FOLLOWING
         )   AS purchwithin3days

Then, you can find just all records with purchwithin3days > 1, like this:

 WITH    got_gaps AS
  (
   SELECT item
   , store
   , purchase_date
   , COUNT(*) OVER ( PARTITION BY  store, item
                          ORDER BY    purchase_date
                   RANGE BETWEEN INTERVAL '3' DAY PRECEDING
                             AND INTERVAL '3' DAY FOLLOWING
          )   AS purchwithin3days
   FROM    table_x
  -- WHERE ...  -- If you need any filtering, put it here
  )
  SELECT   store
  ,   item
  ,   purchase_date
  FROM   got_gaps
 WHERE  purchwithin3days >1
  ORDER BY  store
  ,        purchase_date

Using the sample table of Frank, change the records like this:

DELETE FROM table_x;

INSERT INTO table_x VALUES ( 'A', 123, DATE '2011-01-01');
INSERT INTO table_x VALUES ( 'A', 123, DATE '2011-01-03');
INSERT INTO table_x VALUES ( 'A', 123, DATE '2011-01-09');
INSERT INTO table_x VALUES ( 'B', 123, DATE '2011-01-04');
INSERT INTO table_x VALUES ( 'B', 123, DATE '2011-01-11');
INSERT INTO table_x VALUES ( 'B', 123, DATE '2011-01-14');
INSERT INTO table_x VALUES ( 'A', 789, DATE '2011-01-07');

COMMIT;

SQL> SELECT * FROM table_x ORDER BY 1,2,3;

STORE       ITEM PURCHASE_
----- ---------- ---------
A            123 01-JAN-11
A            123 03-JAN-11
A            123 09-JAN-11
A            789 07-JAN-11
B            123 04-JAN-11
B            123 11-JAN-11
B            123 14-JAN-11

7 rows selected.

.. .and the query will return only the purchases of point 123 store A January 1 and January 3 and store B Jan 11 and 14.

SQL>  WITH    got_gaps AS
  2    (
  3     SELECT item
  4     , store
  5     , purchase_date
  6     , COUNT(*) OVER ( PARTITION BY  store, item
  7                            ORDER BY    purchase_date
  8                     RANGE BETWEEN INTERVAL '3' DAY PRECEDING
  9                               AND INTERVAL '3' DAY FOLLOWING
 10            )   AS purchwithin3days
 11     FROM    table_x
 12    -- WHERE ...  -- If you need any filtering, put it here
 13    )
 14    SELECT   store
 15    ,   item
 16    ,   purchase_date
 17    FROM   got_gaps
 18   WHERE  purchwithin3days >1
 19    ORDER BY  store
 20    ,        purchase_date
 21  ;

STORE       ITEM PURCHASE_
----- ---------- ---------
A            123 01-JAN-11
A            123 03-JAN-11
B            123 11-JAN-11
B            123 14-JAN-11

4 rows selected.

Tags: Database

Similar Questions

  • Comparison of dates in Coldfusion

    Hello


    I have a problem with the comparison of date in coldfusion code. I followed the following technique to date comparison:

    < cfset > tag allows you to change all date values in a format:

    < cfset date1 = #CreateODBCDate (FORM. StartDate) # >
    < cfset date2 = #CreateODBCDate (FORM. EndDate) # >
    < cfset date = #CreateODBCDate (xx.enterdate) # >

    Then I did the comparion in the < cfif > tag to return all data in the database that match the criteria:

    < cfif (#DateCompare (date, date1) # NEQ - 1) AND (#DateCompare (date, date2) # NEQ 1) >

    Return dates between date1 and date2.

    I don't get an error message but, my production is not correct. Help, please.

    Vijayvijay77.

    vijayvijay77 wrote:

    I changed the query and used # all about dates. Its generating an error saying:

    Incorrect syntax near '09'.

    I don't understand. I appreciate your pateince with me.

    Vijayvijay77.

    I guess that '09' is the value of one of the form fields and '09' is not a DATE as a computer includes the dates.

    But you'd have a better understanding of what is happening if you knew what SQL statement has been sent to the database.  This can be illustrated by turning on debugging ColdFusion or dumping the variable "result" of the statement.  It can also be included in the error message.  It would be included in the structure of If you where to put a ... block around your query.

  • How to recover data from plsql table in the BI publisher data model

    Hi all

    I created a data model for XML editor report. In the data model I m get plsql table data. for this I created a package with a function in the pipeline. I am able to run sql in sql developer. But if I run the program at the same time, then I got error like "java.sql.SQLSyntaxErrorException: ORA-00904:"XXXXX": invalid identifier.

    I used the same settings in the data model and simultaneous program...

    Please tell me what to do...

    Thanks in advance...

    Kind regards
    Doss

    I think P_ORG_ID is the parameter
    so use

    :P_ORG_ID
    

    -Add
    also why not use simple sql query?

    Published by: Alexandr Sep 14, 2012 04:48

  • Add seconds to date in PLSQL

    Hello
    This is probably very simple, but I don't see it now :(
    How can I add the number (seconds) so far in PLSQL? I bet, there is a function for this.
    Thank you very much
    D.
    declare
     vdate      date;
     vseconds number;
    begin
      vseconds := 5;
      vdate      := to_date('2.1.2010 05:00','dd.mm.yyyy hh24:mi');
    //  vdate := vdate + interval vseconds second ...;
    end;
    declare
     vdate      date;
     vseconds number;
    begin
      vseconds := 5;
      vdate      := to_date('2.1.2010 05:00','dd.mm.yyyy hh24:mi');
      vdate := vdate + vseconds/24/60/60;
    end;
    
  • Shading, comparison of dates and report Word

    Hi guys,.

    I need help. I, I compare a few dates in a table, if I find a date prior to the date today, I have to shade or color the background of this cell in green or red and set the table, in a report to Word.

    Attached, that's what I'm trying. For now I'm just dealing coloring for January. If it works, I will apply it to the other months.

    Need help please.

    James.Morris wrote:

    So definitely pay attention to my comments above and the comment by ben on your formatted string. If you ignore these suggestions and difficulty only the only thing you ask comments, you will be here with more questions or spend a lot of time additional debugging your code.

    As to the specific cell background color, you can access the Word.Tables object instead of the object of the Document that you were using. On this basis, you can go to a specific cell and set the color. As follows:

    I added this to your code and it worked. The digital input from the left is connected to the loop index, it is thus goes to the line concerned for all what cell you analyze now. A key to note here is report indices are base 1 instead of 0-based.

    Even simpler than this, use the Word and the palette of Word tables Shadind.vi table borders!

    Ben64

  • need to comparison of date for the duration of the connection.

    Hello gurus,
    I have a table which qualifies whenever a connection/disconnection occurs in a system. However, the data are not the same line, there is a connection as a line entry and a disconnection as a line input.
    The table is simply: log_hist (user name, position, login, logout, upd_date).
    Login, logout and upd_date are types of data with a format as date (1 January 13 0200').
    I need to qualify when a user connects to the system (opening date of session) and then calculates when they disconnected (disconnect date) assuming that the time of minimum latency between a line for the date of connection and a line for date of disconnection.

    LAG can be used to do this?

    Hello

    An the Heres how:

    SELECT       userid
    ,       LAST_VALUE (login IGNORE NULLS)
               OVER ( PARTITION BY  userid
                         ORDER BY          NVL (login, logout)
                 ) AS prev_login
    ,       logout
    FROM       log_hist
    ORDER BY  userid
    ,            NVL (login, logout)
    ;
    

    From the Oracle 11.2, LAG can be used for this instead of LAST_VALUE.

    I hope that answers your question.
    If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) and also publish outcomes from these data.
    Explain, using specific examples, how you get these results from these data.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).
    See the FAQ forum {message identifier: = 9360002}

    Published by: Frank Kulash, January 23, 2013 16:25

  • get the max value date in plsql

    My data in the table are like that

    Date Col1, Col2
    01/01/2012 A01 100
    01/01/2012 B01 200
    01/01/2012 C01 200

    01/02/2012 C01 100

    01/03/2012 B01 100


    I want to show the result of the query with carry on data like this

    01/01/2012 A01 100
    01/01/2012 B01 200
    01/01/2012 C01 200

    01/02/2012 A01 100
    01/02/2012 B01 200
    01/02/2012 C01 100

    01/03/2012 A01 200
    01/03/2012 B01 100
    01/03/2012 C01 100

    Please help me.

    Hello

    Welcome to the forum!

    If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the results desired from these data.
    Explain, using specific examples, how you get these results from these data.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).
    See the FAQ forum {message identifier: = 9360002}

    I think you want an outer join partitioned (to make sure that all dates are represented for all values in col1) and the analytical LAST_VALUE function, like this:

    WITH     all_dates     AS
    (
         SELECT DISTINCT  dt     -- DATE is not a good column name
         FROM              table_x
    )
    SELECT       a.dt
    ,       x.col1
    ,       LAST_VALUE (col2 IGNORE NULLS) OVER ( PARTITION BY  x.col1
                                                    ORDER BY      a.dt
                                   )           AS col2_shown
    FROM             all_dates  a
    LEFT OUTER JOIN      table_x    x  PARTITION BY  (x.col1)
                                   ON  x.dt = a.dt
    ;
    

    If you would care to post CREATE TABLE and INSERT statements for your sample data, and then I could test this.

  • Comparison of date strings

    Hello

    I have a Varchar2 field in Oracle DB holding a time as 20120419130609883.

    I need to pass a parameter to a query via a DB adapter in SOA suite and get the records from the table with the dates after a certain date, for example get records after 20120415130609883.

    This is my query:
    SELECT ID, NAME, LASTUPDATETIME db.tablename WHERE LASTUPDATEDDATETIME >?

    So I have records in the table with datetime: '20120419130609883' (19 April)
    and I pass the parameter: '20120415130609883' (15 April)

    The query returns nothing. What I am doing wrong?
    I'm sure I'm not doing something very stupid as asking the wrong table.

    Thank you.

    JDeveloper 11.1.1.5

    Hi user,

    How to write the application in pure sql option? In addition, in the conversation above that I saw above, when you make a pure sql option, you usually get a possibility to choose the schema name, which will come only for other database operations.

    There are two things, you can check to confirm.

    1. check the data source of the database adapter and see with what schema is this data source created in the administration console. Now, check if the table you are querying is covered by the same schema (schema with which your data source has been created). If both the pattern is the same, it shouldn't be a warning when you write pure sql code in pure sql option.

    2. Furthermore, if the schema of the source data and the schema that contains the table aren't the same; what you can do is, in the pure option sql make sure you give the scheme name before the table, for example,

    --------

    Select * from schemaname.tablename

    -------

    also while doing the second option, make sure that the schemaname datasource should have privileges to access the tables under the schemaname where your actual table is there. Ask your DBA to assign privileges to the schema if you work with the 2nd option.

    It should work, let me know.

    Hope this helps,
    N

  • Comparison of date ranges

    Hello


    It is called table with columns FROM_DATE and TO_DATE vacation, I have to do a posting as if there are dates entered between these two dates, it should show me the number


    For example: FROM_DATE: March 8, 2011 AND TO_DATE: 9 March 2011 given in the table

    If I try to enter FROM_DATE: 5 March 2011 AND TO_DATE: March 11, 2011


    He has to show me the County again as 1. am try this query, but it is 0. Please suggest me to change


    SELECT COUNT (*) FROM vacation
    WHERE
    (5 March 11 ' between from_date and to_date or)
    11 March 11 ' between from_date and to_date)

    Sudhir_Ness wrote:
    Hello

    It is called table with columns FROM_DATE and TO_DATE vacation, I have to do a posting as if there are dates entered between these two dates, it should show me the number

    For example: FROM_DATE: March 8, 2011 AND TO_DATE: 9 March 2011 given in the table

    If I try to enter FROM_DATE: 5 March 2011 AND TO_DATE: March 11, 2011

    He has to show me the County again as 1. am try this query, but it is 0. Please suggest me to change

    SELECT COUNT (*) FROM vacation
    WHERE
    (5 March 11 ' between from_date and to_date or)
    11 March 11 ' between from_date and to_date)

    Hello

    You can't do the opposite

    select count(*) from holidays
    where
    (from_date between '05-MAR-11' and '11-MAR-11' or
    to_date between '05-MAR-11' and '11-MAR-11' );
    

    Note: haven't tried, but that it can produce the result you want... ;-)

    Johan

  • Bug in comparison to Date?

    Hi all

    Please note the 2 sets of code pasted below. They return both the same output of 1 January 87 ' but the ' < ' and ' > ' signs were exchanged in the control IF condition. No idea why this is happening? Is this a bug or am I missing something here?

    Thank you

    SID

    Code 1:
    ----------

    DECLARE

    THE DATE;

    BEGIN

    THE: = TO_DATE ('01-' |) 'JAN' | ' -'|| substr('1987',3,2), 'DD-mon-YYYY');

    IF months_between(LA,SYSDATE) > 0 THEN

    dbms_output.put_line (la);

    END IF;

    END;


    CODE 2:
    -----------
    DECLARE

    date of temp_start_date_date;

    I have SEVERAL;

    temp_month varchar2 (4);

    BEGIN

    i: = 1;

    temp_month: = "JAN";

    temp_start_date_date: = TO_DATE ('01-' | temp_month |) » -'|| substr('1987',3,2), 'DD-mon-YY');

    IF months_between(temp_start_date_date,SYSDATE) > 0 THEN

    dbms_output.put_line (temp_start_date_date);

    END IF;

    END;

    Published by: the_reckoner on October 15, 2009 05:56

    Hello

    I'm not sure of the question here. Ask yourself why the 1st query does not produce a value, but the second not?

    If so, it's because of your conversion to_date.

    In the 1st query convert you a date using DD-MON-YYYY indicating a date of 1 January 1987 "." Comparing sysdate using months_between which gives-23073, so less than 0.

    In the 2nd query convert you to a date using DD-MON-AA giving a date of January 1, 2087 '. Comparing sysdate using months_between which gives 926, so superior to 0.

    Concerning

    Paul

  • Oracle text using for dynamic comparison of data splitters

    Hello

    I have two tables with similar columns. There is a free text field (e.g. address). Address fields contain 1 to 10 words in different order.
    Address cut into 4 columns: Address1, Address2, address3, zip.

    ***************************************************************************************************************************

    I want to be able to retrieve all related rows in both tables using the CONTAINS operator and/or search fuzzy. Any other solution is more then welcome.

    ***************************************************************************************************************************

    TABLE oldaddress Data:

    12385 OAK LN APT 9898 LAYTON, UT 84040

    TABLE newaddress Data:

    9898 12385 OAK LN LAYTON, UT 84040 APT
    12385 OAK LN APT 9898 LAYTON, UT 84040
    12385 OAK LINE LAYTON, UT 84040
    9898 12385 OAK LN LAYTON UT APARTMENT
    12385, OAK LINE LAYTON, UT 84040

    Please, note that basically {color: #008000} * addresses * are the same{color}. My goal is to recover all of the new addresses by comparing the data to the oldaddress table.

    My steps are:

    -1.
    create the table OLDADDRESS
    (
    ID NUMBER (20) not null,
    ADDRESS1 VARCHAR2 (30),
    ADDRESS2 VARCHAR2 (30),
    ADDRESS3 VARCHAR2 (30),
    POSTCODE VARCHAR2 (10),
    ALL_COLS VARCHAR2 (1)
    );

    -2.
    create the table NEWADDRESS
    (
    ID NUMBER (20) not null,
    ADDRESS1 VARCHAR2 (30),
    ADDRESS2 VARCHAR2 (30),
    ADDRESS3 VARCHAR2 (30),
    POSTCODE VARCHAR2 (10),
    ALL_COLS VARCHAR2 (1)
    );
    -3. Insert data
    Start
    insert into OLDADDRESS (ID, Address1, Address2, ADDRESS3, ZIPCODE) values (' 11, ' OAK 12385 LN ","APT 9898', 'UT LAYTON', 84040');
    insert into NEWADDRESS (ID, Address1, Address2, ADDRESS3, ZIPCODE) values (22, "APT 9898', ' OAK 12385 LN", 'LAYTON UT", 84040');
    insert into NEWADDRESS (ID, Address1, Address2, ADDRESS3, ZIPCODE) values (' 33, ' OAK 12385 LN ","APT 9898', 'UT LAYTON', 84040');
    insert into NEWADDRESS (ID, Address1, Address2, ADDRESS3, ZIPCODE) values (' 44, ' 12385, OAK LN ","APARTMENT 9898', 'UT LAYTON', 84040');
    insert into NEWADDRESS (ID, Address1, Address2, ADDRESS3, ZIPCODE) values (55, ' 12385 OAK LINE","APT 9898', 'UT LAYTON', 84040');
    insert into NEWADDRESS (ID, Address1, Address2, ADDRESS3, ZIPCODE) values (' 12385 OAK LN, 66; "," APT 9898', "LAYTON UT»(, 84040');
    insert into NEWADDRESS (ID, Address1, Address2, ADDRESS3, ZIPCODE) values (77, 'APARTMENT 9898' 12385.', OAK LN', 'LAYTON UT', '84040');
    commit;
    end;

    -4. Created a section of land:
    BEGIN
    CTX_DDL. CREATE_PREFERENCE ("my_datastore", "MULTI_COLUMN_DATASTORE");
    CTX_DDL. SET_ATTRIBUTE
    ("my_datastore",
    "COLUMNS",
    "ADDRESS1, ADDRESS2, ADDRESS3');
    CTX_DDL. CREATE_SECTION_GROUP ('MYGRP', 'BASIC_SECTION_GROUP');
    CTX_DDL. ADD_FIELD_SECTION ('MYGRP', 'FIELD1', 'ADDRESS1', TRUE);
    CTX_DDL. ADD_FIELD_SECTION ('MYGRP', 'FIELD2', "ADDRESS2", TRUE);
    CTX_DDL. ADD_FIELD_SECTION ('MYGRP', 'FIELD3', 'ADDRESS3', TRUE);
    END;
    /

    -- 5. CREATING INDEXES
    CREATE INDEX my_idx WE newaddress (all_cols)
    INDEXTYPE IS CTXSYS. FRAMEWORK
    PARAMETERS
    ("My_datastore of the DATA store
    GROUP of SECTIONS mygrp');

    -6. Select all the fields:

    SQL & gt; Select Address1 address2, address3, postal code
    2 of newaddress
    3 where CONTAINS (all_cols, (12385 & Oak & 9898'), 1) & gt; 0;

    ADDRESS1 ADDRESS2 ADDRESS3 ZIP
    -----
    9898 12385 OAK LN LAYTON, UT 84040 APT
    12385 OAK LN APT 9898 LAYTON, UT 84040
    12385, OAK LN APARTMENT 9898 LAYTON, UT 84040
    12385 OAK LINE APT 9898 LAYTON, UT 84040
    12385 OAK LN. 9898 APT LAYTON, UT 84040
    9898 12385 APARTMENT. LAYTON, UT 84040 OAK LN

    6 selected lines.

    -7. * Here, I am not able to find a way to make massively for several lines? How to use the operator CONTAINS external data instead of text (12385 & Oak & 9898')?
    Should I use ref cursor / bulk collection? Maybe the REGULAR EXPRESSIONS must be useful (and how)? *

    Select Address1 address2, address3, postal code
    of newaddress
    where CONTAINS (all_cols, (' Param 1 & 2 Param & Param 3... &...)) Param no), 1) > 0;

    Param 1 & Param 2 & Param 3... &... Param n refer to ' select address1. » '|| address2 | "| Address3 oldaddress'.

    I use oracle 10g.

    Thank you for coming ;)


    Kind regards

    Julia

    I don't know what kind of output desired, perhaps something like the following.

    SCOTT@orcl_11g> COLUMN old_ad1 FORMAT A15
    SCOTT@orcl_11g> COLUMN old_ad2 FORMAT A15
    SCOTT@orcl_11g> COLUMN old_ad3 FORMAT A15
    SCOTT@orcl_11g> COLUMN new_ad1 FORMAT A15 newline
    SCOTT@orcl_11g> COLUMN new_ad2 FORMAT A15
    SCOTT@orcl_11g> COLUMN new_ad3 FORMAT A15
    SCOTT@orcl_11g> select o.address1 old_ad1, o.address2 old_ad2, o.address3 old_ad3, o.zipcode old_zip,
      2           n.address1 new_ad1, n.address2 new_ad2, n.address3 new_ad3, n.zipcode new_zip,
      3           SCORE (1)
      4  from   newaddress n, oldaddress o
      5  where  CONTAINS
      6             (n.all_cols,
      7              o.address1 || ' ACCUM ' || o.address2 || ' ACCUM ' || o.address3 || ' ACCUM ' || o.zipcode,
      8              1) > 0
      9  ORDER  BY SCORE (1) DESC
     10  /
    
    OLD_AD1         OLD_AD2         OLD_AD3         OLD_ZIP
    --------------- --------------- --------------- ----------
    NEW_AD1         NEW_AD2         NEW_AD3         NEW_ZIP      SCORE(1)
    --------------- --------------- --------------- ---------- ----------
    12385 OAK LN    APT 9898        LAYTON UT       84040
    12385 OAK LN.   APT 9898        LAYTON UT       84040              51
    
    12385 OAK LN    APT 9898        LAYTON UT       84040
    12385 OAK LN    APT 9898        LAYTON UT       84040              51
    
    12385 OAK LN    APT 9898        LAYTON UT       84040
    APT 9898        12385 OAK LN    LAYTON UT       84040              51
    
    12385 OAK LN    APT 9898        LAYTON UT       84040
    12385 OAK LINE  APT 9898        LAYTON UT       84040              26
    
    12385 OAK LN    APT 9898        LAYTON UT       84040
    APARTMENT 9898  12385 .OAK LN   LAYTON UT       84040              26
    
    12385 OAK LN    APT 9898        LAYTON UT       84040
    12385 ,OAK LN   APARTMENT 9898  LAYTON UT       84040              26
    
    6 rows selected.
    
  • Example of Date comparison work not as expected...

    First of all, sorry for the creation of another post.  Didn't know if I should of just added to a previous message (s) now that I have an example of comparison of date/time works do not as expected.

    I understand that the calendar will use the time zone for the device.  My device is located to the EAST (-0500).

    The following code works fine when the time is set to h, however, does not as expected when in AM...

    java.util.Calendar d1 = java.util.Calendar.getInstance (); now
    java.util.Calendar d2 = java.util.Calendar.getInstance (); now
                      
    String date = ' 11/10/2011-05:05;
                      
    yy int = 0, mm = 0, SD = 0, h = 0, e = 0;
                      
    mm = Integer.parseInt (date.substring (0, 2)) - 1; January = 0
    DD = Integer.parseInt (date.substring (3, 5));
    YY = Integer.parseInt (date.substring (6, 10));
    HR = Integer.parseInt (date.substring (11,13));
    MI = Integer.parseInt (date.substring (14.16));

    D2. Set (Calendar.YEAR, AA);
    D2. Set (Calendar.MONTH, mm);
    D2. Set (Calendar.DATE, dd);
    D2. Set (Calendar.HOUR, human resources);
    D2. Set (Calendar.MINUTE, mi);
    D2. Set (Calendar.MILLISECOND, 0);
                      
    String ampm = date.substring (17, 19);
    If (ampm is 'AM')
    {
    D2. Set (Calendar.AM_PM, Calendar.AM);
    }
    on the other
    {
    D2. Set (Calendar.AM_PM, Calendar.PM);
    }
                      
    long t1 = d1.getTime () .getTime ();
    long t2 = d2.getTime () .getTime ();

    String strCurrentDate = new Date (t1) m:System.NET.SocketAddress.ToString ();
    String strActivateDate = new Date (t2) m:System.NET.SocketAddress.ToString ();
                                  
    If (t1 > = t2)
    Dialog.Inform ("current date of" + strCurrentDate + "is superior to activate date of" + strActivateDate);
    If (t1<>
    Dialog.Inform ("current date of" + strCurrentDate + "is less that activate date of" + strActivateDate);

    The result of current date/time is fine, but the result for strActivateDate is returned as "Tue Oct 11 17:15:48 2011 America/New_York '.  Date is fine, however, is not time.  Time ends as PM (17:05).

    Am I missing something obvious here?  Again, excuse me for the post, maybe should added on the previous post, but I think that this new post can be useful to others in the same situation.  Would appreciate any comments.  Thank you 1 million.

    Karim

    It's what I tell you is wrong and how to fix it.

    http://StackOverflow.com/questions/513832/how-do-i-compare-strings-in-Java

    In short: Do not compare with the help of is, use the equals() method.

  • Detection of contours in the recorded data

    Hello

    We will perform a few data capture high speed by using a number of cards SMU-6537.

    Once we captured the data we need to re - charge and to decipher. One of the steps in this decryption will require detection of outlines on specific lines, the data recorded. Traditionally, in a language such as C++, the code would be loop keeping previous comparison of data values. It seems to me that LabVIEW can be a little more intelligent than that, if we knew where to look. Is there a better way, for example replay data through a simulated map? Load the data into a structure and perform a function call to this topic? (We expect a lot of data, so we will not be able to load it all in at once)

    If someone could point us in the right direction that would be more useful,

    Thank you, Jon.

    Hi Jon,

    Thanks for your post on the forum.

    Just to confirm, you want to 'Acquire' continuous data (storing in a file) then "Generate" output based on the data stored after some post-processing/decryption.

    The SMU-653 x series of HSDIO cards use the functions of 'DAQmx API' (known as the VI in LabVIEW) for these tasks. Unfortunately, you will not be able to use a card "simulated" such as those in 'Measurement and Automation Explorer' to re-read data, simulated maps are used to configure tasks, testing and coding of materials who has yet to buy, their output is fixed.

    I can refer you to some (linked below) examples that illustrate how calls DAQmx API allows to acquire and generate data.

    Example - DAQmx: Acquisition of continuous digital high speed for the 6536/6537 (continuously acquires the data stored in RAM on the card)

    Example - build permanently and acquire Source synchronous data with software comparison

    That you connect to the file, I can recommend using ' Producer/consumer' architecture by which data are queued in FIFO memory as it is acquired, so the acquisition loop can run at a faster pace. The data are removed in the second loop of written and lower priority in the file.

    Community example - using producer/consumer Architecture for DAQmx reading and writing to a file

    Your data will then be "loop through" as you would in C++, the post-processing/decryption will be then performed before that data is written through the card.

    I hope this helps during the review of the architecture of your application of Jon.

    Thank you very much

  • Foreign key constraint, not recognized during the synchronization of data with the model dictionary

    Hello

    Data Modeler is a foreign key constraints do not recognize when synchronizing data with the model dictionary, although the foreign key is there (in the database that a data dictionary is read). I can't find any criterion when a foreign key is not recognized by the Data Modeler. Are there limits to the length of the attribute, or the number of columns in a foreign key, or other limitations which may lead to this behavior not to recognize a fk by Data Modeler? I have columns more than 32 characters. I compared with the fk is recognized by DM, but I can't find anything that indicates why it is not recognized.

    I wonder if someone also has constraints of foreign keys that are not recognized in the comparison of data bases and model?

    Thank you

    Robert

    Hi Robert,.

    Thanks for the comments, I logged a bug.

    Philippe

  • Get specific information from XML using PLSQL

    Hi friends,

    XML entry

    ' <? XML version = "1.0" encoding = "UTF-8"? >

    < major >

    < minor >

    < > 12345 line_id < / line_id >

    < service_Line >

    < > 1111 line_id < / line_id >

    < product_id 56789 > < / product_id >

    < / service_Line >

    < service_Line >

    < > 22222 line_id < / line_id >

    < / service_Line >

    < service_Line >

    < > 3333 line_id < / line_id >

    < > 23456 product_id < / product_id >

    < > 999999 product_id < / product_id >

    < / service_Line >

    < service_Line >

    < > 4444 line_id < / line_id >

    < / service_Line >

    < / minor >

    < service_Line >

    < > 5555 line_id < / line_id >

    < > 666666 product_id < / product_id >

    < > 121212 product_id < / product_id >

    < / service_Line >

    < service_Line >

    < > 5555 line_id < / line_id >

    < / service_Line >

    < / major >

    `

    from the above XML code

    I want the line_id and the Product_id of the tag service_line and ignore the line_id in the tag of service_line that does not product_id

    so I need the information below

    Service_line

    product_id

    1111

    56789

    3333

    23456

    3333

    999999

    5555

    666666

    5555

    121212

    Or as

    Service line - 1111

    Product_id - 56789

    Service - line 3333

    Product_id -23456

    Product_id - 999999

    Service - line 5555

    Product_id -666666

    Product_id - 121212'

    Oracle version:

    PL/SQL Release 11.2.0.3.0 - Production

    Thanks in advance

    Come on... I have already answered here: Re: Re: parsing XML and get the required data only PLSQL using

    Please stay focused

    select x.*
    from xmltable(
           xmlnamespaces(default 'urn:xyz:ccw:config:common:data')
         , 'for $i in //serviceLine
              , $j in $i/coveredProduct
            return element r {
              $i/lineId
            , $j/childProductLineId
            }'
           passing v_xml_response
           columns seq_id for ordinality
                 , child_product_line_id  number path 'childProductLineId'
                 , service_line_id        number path 'lineId'
         ) x ;
    

Maybe you are looking for