week number

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter Bailey

    week number

    The following returns the week numbers perfectly:

    Week Number: DateDiff("ww",D ateAdd("ww",-20,[Intake Day]),[TheDate])
    = 0,1,2,3, ...20


    what I would like is to have :

    -1, -2, -3 ...-20

    I am not sure how to acheive this.



  • Wayne Morgan

    #2
    Re: week number

    >Week Number: DateDiff("ww",D ateAdd("ww",-20,[Intake Day]),[TheDate])

    Try reversing the parameters in DateDiff
    DateDiff("ww", [TheDate], DateAdd("ww", -20, [Intake Day]))

    --
    Wayne Morgan
    Microsoft Access MVP


    "Peter Bailey" <peterbailey@an daluz.fsbusines s.co.uk> wrote in message
    news:chi7qn$tat $1@news7.svr.po l.co.uk...[color=blue]
    > The following returns the week numbers perfectly:
    >
    > Week Number: DateDiff("ww",D ateAdd("ww",-20,[Intake Day]),[TheDate])
    > = 0,1,2,3, ...20
    >
    >
    > what I would like is to have :
    >
    > -1, -2, -3 ...-20
    >
    > I am not sure how to acheive this.
    >
    >
    >[/color]


    Comment

    • Trevor Best

      #3
      Re: week number

      Wayne Morgan wrote:
      [color=blue][color=green]
      >>Week Number: DateDiff("ww",D ateAdd("ww",-20,[Intake Day]),[TheDate])[/color]
      >
      >
      > Try reversing the parameters in DateDiff
      > DateDiff("ww", [TheDate], DateAdd("ww", -20, [Intake Day]))
      >[/color]

      or *-1? :-)

      --

      \\\\\\
      \\ \\ Windows is searching
      \ \ For your sig.
      \ \ Please Wait.
      \__\

      Comment

      • Peter Bailey

        #4
        Re: week number

        The solution turned out to be :
        Week Number: DateDiff("ww",D ateAdd("ww",1,[Intake Day]),[TheDate])

        Thanks for the assistance anyway.
        regards
        Peter

        "Trevor Best" <nospam@localho st> wrote in message
        news:413cc12e$0 $26613$afc38c87 @auth.uk.news.e asynet.net...[color=blue]
        > Wayne Morgan wrote:
        >[color=green][color=darkred]
        > >>Week Number: DateDiff("ww",D ateAdd("ww",-20,[Intake Day]),[TheDate])[/color]
        > >
        > >
        > > Try reversing the parameters in DateDiff
        > > DateDiff("ww", [TheDate], DateAdd("ww", -20, [Intake Day]))
        > >[/color]
        >
        > or *-1? :-)
        >
        > --
        >
        > \\\\\\
        > \\ \\ Windows is searching
        > \ \ For your sig.
        > \ \ Please Wait.
        > \__\
        >[/color]


        Comment

        Working...