03-29-2011 03:56 PM
On a related note, how do i Format to String a datetime with fixed decimal point ... %T doesn't quite cut it, nor does %<%.3x %X>T help.
/Y
03-29-2011 06:46 PM
How about "%<%x %.3X>T"? %x is the date and nobody wants to see fractional days.
03-30-2011 12:28 AM
Thanks Rolf, but it results in localized decimal sign in the string.
/Y
03-30-2011 05:10 AM
Have you tried to prepend %.; to the format string for Format into String? That may however not be what you want, since the ADO/ODBC driver or the actual database backend may expect localized decimal strings.
03-30-2011 07:03 AM
Yeah i tried %.; both in the beginning of the format and inside the %<>T (the latter causing an error).
/Y
03-30-2011 08:04 AM - edited 03-30-2011 08:05 AM
Try this?
Notice that the format string starts with %.;
That hardcodes the decimal to a period. The entire string is totally hardcoded, though. So you'd have to make sure your DB is expecting one specifc hardcoded format, no matter where it is deployed. Which I am guessing isn't so hard.
03-30-2011 09:36 AM
03-31-2011 01:53 AM
@Jos, yes that's a workaround to a bad implementation. I'll post a descriptive picture.
Observe that neither Boolean nor DateTime can be inserted straight off the bat. I thought the whole idea was to use clusters that matched the database fields ...
/Y
03-31-2011 06:25 AM - edited 03-31-2011 06:26 AM
@Yamaeda wrote:
@jos, yes that's a workaround to a bad implementation. I'll post a descriptive picture.
Observe that neither Boolean nor DateTime can be inserted straight off the bat. I thought the whole idea was to use clusters that matched the database fields ...
In theorie yes. And I understand your frustration, but the Database Conenctivity Toolkit makes use of the Windows ADO system. This is a generic ActiveX based database interface that has to work for all databases that come with either an ADO or ODBC driver. And all those drivers have very different ideas about what ADO or ODBC specifically means. When you program an application to interface to a specific database backend you usually do not worry about SQL syntax and functionality difference (well you might have to when you upgrade the database backend ) but this luxery is not possible for the people writing the Database Connectivity Toolkit.
Sometimes you simply have only the choice between either limiting certain functionality for certain databases or failing for some others when you want to keep it generic. The alternative is to make the interface database backend specific with lots of configuration functionality for most functions where the programmer has to enable or disable some features depending on the database he is using. Such an interface is even more cumbersome to develop and especially maintain, and a complete nightmare for most but the very advanced database programmers to use.
But the fact that prepending %.; doesn't work for absolute (and maybe relative) timestamp formats in Format into String is definitely a bug. NI needs to put that in their CAR database.
03-31-2011 07:43 AM
I don't really understand the frustration. Just use that snippet I provided to create the dattime string. And then use it to create your own INSERT statement and then feed it to this VI. Its a simple and functional workaround.