# need a slicker way

mcnews
Guest
Posts: n/a

 9th Feb 2012
to do this:

....
ElseIf (Day(Date) > 12 And Month(Date) = 12 And Day(Date) < 18 And Month(Date) = 12) Then
Week = "49"
ElseIf (Day(Date) > 19 And Month(Date) = 12 And Day(Date) < 25 And Month(Date) = 12) Then
Week = "50"
ElseIf (Day(Date) > 26 And Month(Date) = 12 Or Day(Date) < 1 And Month(Date) = 1) Then
Week = "51"
ElseIf (Day(Date) > 2 And Month(Date) = 1 And Day(Date) < 8 And Month(Date) = 1) Then
Week = "52"
ElseIf (Day(Date) > 9 And Month(Date) = 1 And Day(Date) < 16 And Month(Date) = 1) Then
Week = "1"
ElseIf (Day(Date) > 16 And Month(Date) = 1 And Day(Date) < 23 And Month(Date) = 1) Then
Week = "2"
ElseIf (Day(Date) > 23 And Month(Date) = 1 Or Day(Date) < 30 And Month(Date) = 1) Then
Week = "3"
....

mcnews
Guest
Posts: n/a

 9th Feb 2012
Public Function FluWeek(ByVal sDate As Date) As String
Dim x As Integer
x = Int((CDate(sDate) - CDate("10/23/2011")) / 7) + 42
If x > 52 Then
x = x - 52
End If
FluWeek = Trim(Str(x))
End Function

 Thread Tools Rate This Thread Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Keith Patrick Windows Vista General Discussion 13 30th May 2007 09:52 PM extrude-o_matic General 19 8th Nov 2005 05:15 PM Adam Turner Windows XP General 0 7th Apr 2004 09:17 PM =?Utf-8?B?Qnl0ZQ==?= Windows XP General 0 7th Apr 2004 08:31 PM =?Utf-8?B?Zmd1aWhlbg==?= Windows XP Networking 0 30th Dec 2003 09:51 PM

Features

Newsgroups

All times are GMT +1. The time now is 05:18 AM.