By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,672 Members | 1,628 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,672 IT Pros & Developers. It's quick & easy.

Creating an Optional Date Parameter

P: n/a

What should the default value for an optional Date parameter be in a
function if I want it to default to Nothing?

Setting the optional value to "" fails, so does setting it to Nothing.

Function blah(byval User as string, Optional byval UserDate as Date = ?????)

Thanks (again)

Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Use DateTime.MinValue, and then check to make sure the passed value is
greater than that inside the function body.

"Learning SQL Server" <no.mail.com> wrote in message
news:Ol****************@TK2MSFTNGP09.phx.gbl...

What should the default value for an optional Date parameter be in a
function if I want it to default to Nothing?

Setting the optional value to "" fails, so does setting it to Nothing.

Function blah(byval User as string, Optional byval UserDate as Date = ?????)
Thanks (again)

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.