![Çözüldü](images/icons/cozuldu.png)
Arkadaşlar merhaba bulunulan aydaki tarihin ayın kaçıncı haftası olduğunu öğrenmek için "weekday" komutuyla denedmi yapamadım. Nasıl yapabilirim?
Public Function WeekInMonth(dte As Date) As Integer
Dim strMonthYear As String
Dim dteFirstMonth As Date
Dim intDaysDiff As Integer
Dim intDayFirstOfMonth As Integer
strMonthYear = Month(dte) & "/" & Year(dte)
dteFirstMonth = "01" & "/" & strMonthYear
intDayFirstOfMonth = WeekDay(dteFirstMonth, vbMonday)
intDaysDiff = (dte - dteFirstMonth) + intDayFirstOfMonth - 1
WeekInMonth = Int(intDaysDiff / 7) + 1
End Function
(29/09/2017, 13:54)serkan1985 yazdı: Ozan bey fonksiyonu ekledim ama "DATE(WW)" sütununda nası tarihe göre atıycak tam anlayamadım. Örnek ekte yardımcı olabilirseniz çok sevinirim.