Jump to content

Insert NULL value in a SQL Server datetime field


Recommended Posts

Hi,

 I'm trying to insert some NULL values in a datetime field.

In the example, the DATA_INSERIMENTO field has a non empty value and it works correctly but DATA_INTERVENTO doesn't accept NULL.
If I use an empty string instead of null, the VI run without any errors but it fill the database field with a 1900-01-01 and it's not what I want.


nullstring1.png

 

If I use the DB Tools NULL VI it gives me another type of error, maybe 'cause I'm connecting a variant to a cluster of string.
If i use a Variant to Data VI for the NULL value it returns an empty string so not the result I need.

 

nullstring2.png

If use the string you see in the label at the bottom of my diagram in SQL Server manager, it works correctly.
How can I obtain the same result with labview?

Edited by Gepponline
Link to comment

If the value is null, you could probably just leave it out from the insert (ie insert using a 3 element array and a 3 element cluster, leaving out the null value).

Worst comes to worst, you could create the insert string yourself and execute it, but I know thats not ideal.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.