Translating the serial number of calendar week into "week of _______

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • egrill
    New Member
    • Jul 2007
    • 16

    Translating the serial number of calendar week into "week of _______

    I have figured out how to extract the serial number of date field into the corresponding number of the week using the DatePart function. The would like to take the 5 and translated it identify the week of associate with the series. For example if the serial number was 5 it corresponds the the fith week in January which is the week of January 28th. Does have a work around or knowledge of the next steps to get this information. Thank you

    Expr1: DatePart("ww",[ORDER_DATE])
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    If I understand correctly then you can get the day of the week, subtract it from the date and that'll give you the first date of the week.

    Comment

    • egrill
      New Member
      • Jul 2007
      • 16

      #3
      Originally posted by Rabbit
      If I understand correctly then you can get the day of the week, subtract it from the date and that'll give you the first date of the week.
      Thank you. I think that would just cause the date to change. I need to sort so I can have the records within the same serial (week) together. Thank you again for the assistance.

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        You don't have to change the value, you can either sort by a calculated value or create a calculated column and sort by that.

        Comment

        • tcveltma
          New Member
          • Jul 2007
          • 36

          #5
          Would you mind elaborating a little?

          Rabbit
          You don't have to change the value, you can either sort by a calculated value or create a calculated column and sort by that.
          Thanks,
          Tiffany

          Comment

          • missinglinq
            Recognized Expert Specialist
            • Nov 2006
            • 3533

            #6
            I'm not sure of exactly what you're trying for, but if it's to identify the first day of the week that a given date falls in, something like:

            [CODE=vb]WeekOF = "Week of " & Order_Date-(weekday(Order_ Date)-1)[/CODE]

            Comment

            • Rabbit
              Recognized Expert MVP
              • Jan 2007
              • 12517

              #7
              Originally posted by missinglinq
              I'm not sure of exactly what you're trying for, but if it's to identify the first day of the week that a given date falls in, something like:

              [CODE=vb]WeekOF = "Week of " & Order_Date-(weekday(Order_ Date)-1)[/CODE]
              Similar to what linq is proposing except for sql:

              [Code=sql]WeekOf: "Week of " & Order_Date-(weekday(Order_ Date)-1)[/CODE]
              This in no way changes the value in the table. It's just a calculation that gets performed whenever you run the query and you view the results.

              Comment

              • egrill
                New Member
                • Jul 2007
                • 16

                #8
                Thank you it worked just great. Thank you for the assistance

                Comment

                • Rabbit
                  Recognized Expert MVP
                  • Jan 2007
                  • 12517

                  #9
                  Not a problem, good luck.

                  Comment

                  Working...