Can anyone tell me ? .How should i get current weekno on the basis of sytem date .let me know please .any help would be highly appreciated .
Code:
Option Explicit
Private Sub Command1_Click()
GetCurentWeekNo (Now)
End Sub
Public Sub GetCurentWeekNo(CurDate As Date)
Dim myDate As Date
myDate = Format(CurDate, "dd/mm/yyyy")
Dim mYear As Integer
Dim mMonth As Integer
Dim mDay As Integer
mYear = Format(myDate, "YYYY")
mMonth = Format(myDate, "mm")
mDay = Format(myDate, "dd")
Dim dteStartOfYear As Date
Dim dteWorkingDate As Date
Dim intWeeks As Integer
dteStartOfYear = DateSerial(2012, 7, 1)
dteWorkingDate = DateSerial(mYear, mDay, mMonth)
intWeeks = DateDiff("ww", dteStartOfYear, dteWorkingDate)
MsgBox intWeeks
End Sub