Example Code

DataBase: Gathering Information in a Specific Date/Time Range

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

Overview
This example VI show how to retrieve information from a table in database which has columns defined as Date/Time data type.

Description
This example has been tested with Microsoft Access 2013 and the most important is that you can retrieve information from a table in database which has columns defined as Date/Time data type. The most important in this example is to show you how to build your query since TimeStamp in LabVIEW must be reformatted in order to get a Microsoft Access valid format.
This example has been built with an Event Producer Consumer structure. You can execute two specific queries:
SELECT * FROM table_name
SELECT * FROM table_name WHERE column_with_dates BETWEEN time_stamp_1 AND time_stamp_2

 

Requirements
LabVIEW 2012 (or Compatible)
Database Connectivity Toolkit 2009 (or Compatible)
Access 2013 (or Compatible)

 

Steps to Implement or Execute Code

  • Run the Vi
  • If necessary, modify query parameters
  • Retrieve all data or Execute query and look at the results

 

Additional Information or References

VI Block Diagram

Querying Data Range.png

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

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.

Comments
HunterSeeker
Member
Member
on

Thanks for posting, Great Example

Thanks

Hunter

ssingh1
Member
Member
on

unable to open in LV 8.2