English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Hello All,
I have one condition that Is got Date value from field in VB6 programming then it will insert same date other wise if Date field is empty then a 'null' value should be insert into table.
The date field datatype is 'datetime'.

I have created a Stored Procedure and passing date value as follows.
StoreProcedure IIF(IsDate(text1.text),Text1.text,null)

It is giving error "Invalid us of null" and also giving error from SQL Query manage if I pass
StoredProcedure null


Please help me
thanks in advance

2007-01-03 23:26:49 · 4 answers · asked by Jack J 1 in Computers & Internet Programming & Design

In the above not showing
"IIF(IsDate(text1.text), Text1.text,null)"

2007-01-03 23:28:39 · update #1

4 answers

Try passing DBNull.value instead of NULL to the SQL server

2007-01-04 03:28:09 · answer #1 · answered by rod 6 · 0 0

http://www.c-sharpcorner.com/Code/2003/Sept/EnterNullValuesForDateTime.asp

But to be perfectly honest, why do you want null values for DateTime? Optimize your system and build a table that normalizes your need to use a datetime function.

2007-01-03 23:34:11 · answer #2 · answered by Jason W-S 4 · 0 0

you can check the option of "allow null" or "not null" in the column of the database and it will be ok.

2007-01-03 23:31:07 · answer #3 · answered by Anonymous · 0 0

surely, it somewhat is already Saturday. regardless of the undeniable fact that, truly, it somewhat is the day God stopped poofing. He poofed for 6 days, and on the seventh rested. So fairly of celebrating the poofing, we rejoice the resting. even yet it somewhat is nonetheless meant to remind us to think of relating to the six days he spent poofing.

2016-11-26 02:31:27 · answer #4 · answered by ? 4 · 0 0

fedest.com, questions and answers