Milliseconds are lost when writing timestamp with LabVIEW Database Connectivity Toolkit

Updated Aug 14, 2025

Issue Details

When inserting timestamp data into a PostgreSQL database with LabVIEW using the DB Tools Insert Data.vi from the Database Connectivity Toolkit, the numbers after the comma (milliseconds) are lost. How do I make the timestamp retain these values after adding them to the DB?

Solution

When using DB Tools Insert Data.vi to directly add data to a certain column in a database, will cause this issue where milliseconds are lost from the timestamp.

Using DBTools to add data to database

Figure 1. Adding timestamp value with milliseconds using DB Tools Insert Data.vi into the Timestamp column. The values after the comma will be lost.

In order to counter this, another VI can be used, namely the DB Tools Execute Query.vi. Although this VI does not manage the query for you to directly insert data like the DB Tools Insert Data.vi does, it will keep the milliseconds when the timestamp is added to the database.

DB Tools Exec Query

Figure 2. Using DB Tools Execute Query.vi will require sending the whole query command as a string, but the timestamp will keep the milliseconds this way.