+ Reply to Thread
Results 1 to 3 of 3

Thread: Check if date dd/MM is in interval without yyyy

  1. #1
    grmotild is offline VB.NET Forum Newbie grmotild is on a distinguished programming path ahead
    .NET Framework
    .NET 2.0 (VS 2005)
    Join Date
    Jun 2009
    Age
    40
    Posts
    2
    Reputation
    0

    Default Check if date dd/MM is in interval without yyyy

    Hello.
    Will appreciated for any help in VB.NET.
    I need to check my field in format ddMMyyyy(ex 12/03/1990) whether in interval of two dates that user picks from

    two date picker controls. Two date pickers are in custom format dd/MM. It does not matter for me if its between

    particular years. I need just to know if given Birthday belongs to interval taken from screen. Each datepicker gives

    values dd/mm/yyyy. I do not know how to check it. For example:
    Given date 12/03/1990 . User select two values from screen: From 01/01/1950 Upto 30/04/1949(or 1990, or 2000)
    Result should be True.Because 12 march is between 01 Januar and 30 April.

    Thank you in advance
    Michael G.

  2. #2
    Robert_Zenz's Avatar
    Robert_Zenz is offline VB.NET Forum Idol Robert_Zenz master of VB.NET Robert_Zenz master of VB.NET Robert_Zenz master of VB.NET Robert_Zenz master of VB.NET Robert_Zenz master of VB.NET Robert_Zenz master of VB.NET Robert_Zenz master of VB.NET Robert_Zenz master of VB.NET Robert_Zenz master of VB.NET
    .NET Framework
    .NET 2.0
    Join Date
    Jun 2008
    Location
    Vienna, Austria
    Age
    23
    Posts
    503
    Reputation
    296

    Default

    Code:
    If yourDate.Month >= Me.DateTimePicker1.Value.Month AndAlso yourDate.Month =< Me.DateTimePicker2.Value.Month Then
          If yourDate.Day >= Me.DateTimePicker1.Value.Day AndAlso yourDate.Day =< Me.DateTimePicker2.Value.Day Then
                'do something
          End If
    End If
    Bobby
    Don't give TypeCasting Errors a chance, turn ON Option Strict!
    Greatest Obfuscator ever: EazFuscator (Freeware)
    Greatest Reflection Tool ever: .NET Reflector (Freeware) with Add-Ins
    Greatest Introspection Tool ever: Gendarme (GPL)
    Greatest MySQL FrontEnd ever: MySQL-Front (Shareware), HeidiSQL (GPL)

  3. #3
    grmotild is offline VB.NET Forum Newbie grmotild is on a distinguished programming path ahead
    .NET Framework
    .NET 2.0 (VS 2005)
    Join Date
    Jun 2009
    Age
    40
    Posts
    2
    Reputation
    0

    Default

    Thank you very much

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts