Example Code

Querying a DataBase Using Time Stamps (stored as DBL) as Conditional Clause in LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW Database Connectivity Toolkit
  • LabVIEW

Code and Documents

Attachment

Description

 1. Overview

With this VI you can query using two time stamp controls as conditional clause in order to get filtered information.

 

2. Description

This example is part of a series of three. By this time we have our Data Base with one table of four columns. One of these columns contains dates which are stored in seconds as Double.Data Type. With this VI you can query using two time stamp controls as conditional clause in order to get filtered information. For example, if you need to get all the information stored between 13/05/2009 06:00:00.000 a.m. and 13/05/2009 08:00:00.000 p.m. you only need to complete the query in the front panel by filling the String and Time Stamp controls.

 

3. Requirements

  • NI LabVIEW Professional Development System 2012 (or compatible).
  • NI Database Connectivity Toolkit 2012 (or compatible).

 

4. Steps to Implement or Execute Code

  1. 1. Download the compressed files
    2. Open "Time Stamps Query LabVIEW 2012 NIVerified.vi"
    3. Select the Connection information (udl file)
    4. You can complete the query if you need to get specific columns or just simply write * in the control Column.
    5. Write the name of the column which stores your date/time data (it has to be previously stored as DBL) in Column to Condition.
    6. Use the First Date and Last Date Time Stamps controls to select the date/time condition.
    7. Run the VI

 

5. Additional Information or References

Time Stamps Query Screenshot.PNG

 

 

**The code for this example has been edited to meet the new Community Example Style Guidelines.**

Arturo Gómez | Applications Engineering
Certified LabVIEW Associated Developer

National Instruments Latin America
01-800-010-0793
ni.com/support

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.