Hi. In my VB.NET application I need to identify whether or not a user-input
date falls in between certain date ranges. For example, If I know my date
range is 4/1/2008 - 5/1/2008, and a user inputs 4/3/2008, I would need a
boolean TRUE indicating that the input date falls between date ranges.
I know I could do greater than/less than comparisons, but I want to check if
there's a simpler way to accomplish this.
Thank you.
"Mike" <Mike@discussions.microsoft.com> schrieb:
> Hi. In my VB.NET application I need to identify whether or not a
> user-input
> date falls in between certain date ranges. For example, If I know my
> date
> range is 4/1/2008 - 5/1/2008, and a user inputs 4/3/2008, I would need a
> boolean TRUE indicating that the input date falls between date ranges.
\\\
Dim d As Date = Date.ParseExact(...)
Dim IsDateInRange As Boolean = _
(d >= #4/1/2008# AndAlso d <= #4/3/2008#)
///
>I know I could do greater than/less than comparisons,
> but I want to check if there's a simpler way to accomplish
> this.
I don't see why this way is not simple enough.

Signature
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
SurturZ - 10 Mar 2008 06:43 GMT
Using greater than & less than is only one line of code, how much simpler can
it get??

Signature
David Streeter
Synchrotech Software
Sydney Australia
> "Mike" <Mike@discussions.microsoft.com> schrieb:
> > Hi. In my VB.NET application I need to identify whether or not a
[quoted text clipped - 15 lines]
>
> I don't see why this way is not simple enough.