*$#&% Date - Part 2

  • Thread starter Thread starter Jeff
  • Start date Start date
Jeff said:
What is the best way to set an optional date parameter to
a sub?


No really good way.

Here are your options:

1 Use an overload instead.

2 Default it to Date.MinValue, and then remember to check downstream.

3 Type it as object and send real Date or Nothing, or perhaps DbNull.Value.


David
 
Using an Overload is a good idea, Thanks!

BTW you can't use Date.MinValue because it is not a
constant.
 
Jeff said:
Using an Overload is a good idea, Thanks!

BTW you can't use Date.MinValue because it is not a
constant.

In VB, the constant #12:00:00 AM# will give you Date.MinValue.

David
 
Back
Top