Sorting formatted date field "YYYY/'WW" in a cross tab - access 2007

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • merritth
    New Member
    • Mar 2020
    • 2

    Sorting formatted date field "YYYY/'WW" in a cross tab - access 2007

    Hi - I'm trying to create a crosstab using week number and year - WeekNum: Format([ds_ship_date],"yyyy/ww"), everything appears to work but in the cross tab it sorts as 2020/1, 2020/10,2020/2..

    Please help how I can make it work!
  • cactusdata
    Recognized Expert New Member
    • Aug 2007
    • 223

    #2
    You can use Format twice:

    Code:
    WeekNum: Format([ds_ship_date], "yyyy\/") & Format(DatePart("ww", [ds_ship_date]), "00")

    Comment

    • merritth
      New Member
      • Mar 2020
      • 2

      #3
      Works perfectly! Thanks a ton that really helped.

      Comment

      Working...