*$#&% Date - Part 2

D

David Browne

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
 
J

Jeff

Using an Overload is a good idea, Thanks!

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

David Browne

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top