Currently, i have this code.
Dim iCurrentDate As Date = Now
Dim iStartDate As Date = CDate(dtFrom.Text)
Dim iEndDate As Date = CDate(dtTo.Text)
If (iCurrentDate > iStartDate) And (iCurrentDate < iEndDate) Then
Console.WriteLine("Current date is within the range.")
'Other Codes here
Else
Console.WriteLine("Current date is in the range.")
'Other Codes here
End If
OR
Dim iObj As Object = IIf((iCurrentDate > iStartDate) And (iCurrentDate < iEndDate), "Current date is within the range.", "Current date is in the range.")
Console.WriteLine(iObj.ToString)
'Other Codes here
Is there any substitute in the above code? Just like BETWEEN
in sql queries?