Get Minimum and Maximum date

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • itsolutionsfree@gmail.com

    #1

    Get Minimum and Maximum date

    Hi All,

    i am deep trouble.so,plea se help me how to get minimum and maximum
    dates for particular Month and Year.Any kind of help will help.

    for ex: im passing : March 2006

    Minimum Date - 01/March/2006
    Maximum Date - 31/March/2006

    my code:

    public sub MinMaxdate(ByVa l MonInt as integer,ByVal YeaInt as integer)
    Dim MinInt as integer
    Dim MaxInt as integer

    msgbox "Minimum Date " & "MinInt" & " Of " & MonInt & "/" & YeaInt
    msgbox "Maximum Date " & "MaxInt" & " Of " & MonInt & "/" & YeaInt

    end sub

    With Regards,
    IT SolutionsFree

  • Larry Lard

    #2
    Re: Get Minimum and Maximum date


    itsolutionsf... @gmail.com wrote:[color=blue]
    > Hi All,
    >
    > i am deep trouble.so,plea se help me how to get minimum and maximum
    > dates for particular Month and Year.Any kind of help will help.
    >
    > for ex: im passing : March 2006
    >
    > Minimum Date - 01/March/2006
    > Maximum Date - 31/March/2006[/color]

    Dim m as integer = 3 ' month
    dim y as integer = 2006 ' year

    Dim FirstDate As Date = New DateTime(y, m, 1)
    Dim LastDate As Date = FirstDate.AddMo nths(1).AddDays (-1)

    --
    Larry Lard
    Replies to group please

    Comment

    Working...