CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Date

  1. #1
    Join Date
    May 2001
    Posts
    1

    Date

    How do I calculate in which week (first weekday monday) of the month is the first and the third Monday? I´d like to get it like: "28 May 2001 => 4th May week" or "4 Jun 2001 => 1st June week".

    Thank you


  2. #2
    Join Date
    Apr 2000
    Posts
    737

    Re: Date


    public Function DayInWhichWeek(byval Day as Long, byval Month as Long, byval Year as Long) as Long
    Dim dayWeek as Long
    Dim dDate as date

    dDate = CDate(MonthName(Month) & " 1," & CStr(Year))
    dayWeek = Weekday(dDate)

    DayInWhichWeek = ((dayWeek + Day - 2) \ 7) + 1


    End Function




    HTH

    cksiow
    http://vblib.virtualave.net - share our codes


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured