Showing posts with label dbnull. Show all posts
Showing posts with label dbnull. Show all posts

Friday, February 24, 2012

How to set default date in SQL to

somthing other than 1/1/1900? I use Visual Studio.NET and Aspx.
Even if I pass a system.dbnull.value to the table, it keeps showing
a default date of the above. I want to end-up with a <NULL> for the
date entry from my code when a user deletes a date from my
aspx page.

Thanks,You can mix something from:

use a DEFAULT constraint to your date column
use NULLIF() function with an out-of-range date
use ISNULL() function with an out-of-range date
and check that your table supports NULLs in your date column

we also have problems passing nulls via VB6 (must be variants).

Cesar.|||Thanks Cesar,

I saw a KB on Microsoft saying that functionality is a bug but don't see
they fixed it. I will give the ole variant a try. Thanks again.

BobbyJ