ni.com is currently undergoing scheduled maintenance.
Some services may be unavailable at this time. Please contact us for help or try again later.
To download NI software, including the products shown below, visit ni.com/downloads.
Overview
You can use the attached VI to convert strings that are output as a date/time yyyy-mm-dd hh:mm:ss format from the "DB Tools Format Datetime Str VI" to a mm/dd/yyyy hh:mm:ss AM/PM format that is accepted by a SQL query.
Description
This can be used as a subVI in a larger application that uses the Database Connectivity Toolkit. The VI reads in a string input from the "DB Tools Format Datetime Str VI" and uses several "Search/Split String VIs" to break apart the current format. Then the VI concatenates all of the strings back to a single string output in a format that is accepted by a SQL query.
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Snippet
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Could you include a screenshot of the code? Thanks!
The AM/PM should be calculated if the hour is greater than 11, not 12. 12:00:00-23:59:59 is PM.