How do you return a null date in VBA? The value zero in Excel VBA is a
valid date (i.e. 30-Dec-1899), even negative numbers are valid (e.g.
-ve 999 is 05-Apr-1897). The usual solution is to use a known date to
signify a null value, preferably one which is implausible in the
context of your app. For example, in a recent project here we used
Newton's birthday to signify a null, however I wouldn't recommend this
because of a double ambiguity (01/04 or 04/01 depending on your
locality or 25/12 depending on calendar system used!)
Harald Staff wrote
I'm not sure how/if you can set a database field to be Null either.
Sure can. NULL or NOT NULL is an essential definition of a SQL-92
column:
CREATE TABLE MyTable
(
ID INTEGER NOT NULL PRIMARY KEY,
LastName VARCHAR(35) NOT NULL,
FirstName VARCHAR(35) NOT NULL,
MiddleName VARCHAR(35) NULL
);
How to set a column's value to null? Definite as NULL and don't put
anything in it! However, even with databases it's recommend to
disallow nulls and specify a default value to use if nothing is put in
the column e.g.
MiddleName VARCHAR(35) NOT NULL DEFAULT '{{NK}}'
--