LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error of Date format when writing to a file

Hello,
 
I built a Database with tables that contained many variables with different formats (number and date/time format). Using the Database Connectivity Toolkit I query the information that I need from that DB and I write it to a txt file. The problem is that I must convert the array format in order to write it to the file and when I do this I lose the Date format. 
For example: when the root date is "27/10/2003" it changes to "27".
How can I solve this problem?
I attach a picture of the diagram and the VI I use.
 
Thank you,
Nuria
 
 
Download All
0 Kudos
Message 1 of 3
(2,604 Views)
You're converting the results from the query into a string and you have "27/10/2003"? You then convert the entire array to numbers and "27/10/2003" the only valid number is "27". The rest after the the first "/" is discarded. That's how Fract/Exp String to Number is supposed to work since "27/10/2003" is not a valid number. Instead of converting to numbers, modify Write To Spreadsheet File so that you can input your string array. There are instructions on how to do this on the block diagram of Write to Spreadsheet File. Also, Why are you using a local variable for "Variables a mostrar"? It's absolutely unneccessary and just creates a copy of your data.
0 Kudos
Message 2 of 3
(2,594 Views)

Hello Dennis,

I modified the Write To Spreadsheet File and now it works fine!

Thank you! Smiley Happy

0 Kudos
Message 3 of 3
(2,574 Views)