need a slicker way

Discussion in 'Microsoft Access Getting Started' started by mcnews, Feb 9, 2012.

  1. mcnews

    mcnews Guest

    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, Feb 9, 2012
    #1
    1. Advertisements

  2. mcnews

    mcnews Guest

    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
     
    mcnews, Feb 9, 2012
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ChrisP

    Re: correct way to use a recordset

    ChrisP, Jun 24, 2003, in forum: Microsoft Access Getting Started
    Replies:
    1
    Views:
    747
    Sandra Daigle
    Jun 25, 2003
  2. Rob Rowell

    Best way to tackle Calendars and Appointment Recurrence in Access

    Rob Rowell, Jul 30, 2003, in forum: Microsoft Access Getting Started
    Replies:
    1
    Views:
    603
  3. Guest

    I need to build a proposal on a program we need built for our sup.

    Guest, Apr 25, 2005, in forum: Microsoft Access Getting Started
    Replies:
    1
    Views:
    135
    Jeff Boyce
    Apr 27, 2005
  4. ABE_GED_Rickster

    I need a way for my students to clock-in & clock-out of classes

    ABE_GED_Rickster, May 23, 2008, in forum: Microsoft Access Getting Started
    Replies:
    1
    Views:
    154
    TomAntiTelecom
    May 23, 2008
  5. kingmarki123

    Help! I need to know which office products I need. I'm clueless!

    kingmarki123, Aug 14, 2009, in forum: Microsoft Access Getting Started
    Replies:
    1
    Views:
    154
    Arvin Meyer [MVP]
    Aug 15, 2009
Loading...

Share This Page