Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Determine  the  Week  of  the  Month  a  Date  Falls  In  

 Content of Determine the Week of the Month a Date Falls In.vbs
MD5 Hash: 7DD977EFA8AA009AB9ACB010D665F575
dtmTargetDate = #12/19/2005#

dtmDay = DatePart("d", dtmTargetDate)
dtmMonth = DatePart("m", dtmTargetDate)
dtmYear = DatePart("yyyy", dtmTargetDate)

dtmStartDate = dtmMonth & "/1/" & dtmYear
dtmStartDate = CDate(dtmStartDate)

intWeekday = Weekday(dtmStartDate)
intAddon = 8 - intWeekday

intWeek1 = intAddOn
intWeek2 = intWeek1 + 7
intWeek3 = intWeek2 + 7
intWeek4 = intWeek3 + 7
intWeek5 = intWeek4 + 7
intWeek6 = intWeek5 + 7

If dtmDay <= intWeek6 Then
strWeek = "Week 6"
End If

If dtmDay <= intWeek5 Then
strWeek = "Week 5"
End If

If dtmDay <= intWeek4 Then
strWeek = "Week 4"
End If

If dtmDay <= intWeek3 Then
strWeek = "Week 3"
End If

If dtmDay <= intWeek2 Then
strWeek = "Week 2"
End If

If dtmDay <= intWeek1 Then
strWeek = "Week 1"
End If

Wscript.Echo strWeek



   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a