PC Review


Reply
Thread Tools Rate Thread

Creating an Optional Date Parameter

 
 
Learning SQL Server
Guest
Posts: n/a
 
      27th Aug 2003

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)



 
Reply With Quote
 
 
 
 
Russell Jones
Guest
Posts: n/a
 
      27th Aug 2003
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:Ol7tI%(E-Mail Removed)...
>
> 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)
>
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Optional parameter Curious Microsoft Dot NET 2 3rd Aug 2008 07:21 PM
optional parameter =?Utf-8?B?QmVu?= Microsoft Excel Programming 3 21st Apr 2006 07:11 PM
Optional date parameter initialization =?Utf-8?B?Sm9obiBBdXN0aW4=?= Microsoft VB .NET 5 9th Sep 2005 05:47 PM
Optional parameter in Date Function John Morgan Microsoft VB .NET 10 13th Nov 2003 06:07 PM
Re: Optional parameter for c# Rajasi Saha [MS] Microsoft C# .NET 0 21st Aug 2003 08:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:22 AM.