ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems using SQL Wizard

Hello,
 
I found very useful your SQL Wizard and I am working with it. It helps me to find the appropiate data for my analysis. But:
 
I have a problem using your SQL Wizard when loading my query to DIAdem. I have two channels named "TFIN" and "TDEB", these are time channels and their format should be hh:mm:ss but when I load them it appears as 30/12/1899 hh:mm:ss.
How can I change these "30/12/1899" to "00/00/00" or how can I eliminate them?
 
 
Thank you very much in advanced.
 
Núria R.
0 Kudos
Message 1 of 2
(3,240 Views)
Hi leiabcn,
 
The simplest way to remove the unwanted (and inaccurate) date information is to execute a FormulaCalculator expression, either interactively or programmatically, using the RTP() function.  For example, from a VBScript you can execute the following code to remove the date information from a channel called "FileDate" which is contained in the 1st group in the Data Portal:
 
L1 = CNo("[1]/FileDate")
Call FormulaCalc("Ch(L1):= RTP(Ch(L1),'h')*3600 + RTP(Ch(L1),'n')*60 + RTP(Ch(L1),'s')")
 
This works because the DIAdem date/time is stored as a DBL counting the number of fractional seconds since 0 AD.
 
Ask if you have additional questions,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,230 Views)