Results 1 to 5 of 5
  1. #1
    anlimah is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2014
    Location
    New York
    Posts
    6

    Sorting days of week in query and report access 2010


    I have a text field in my table called [week day] Monday thru Friday groups transpire in my business. I would like to sort the days of the week in order and not alphabetically. I respectfully request step by step information. I am pulling my hair out. Please assist. Thanks

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Options:

    1. calculate the weekday number in a query and use that calculated field for sorting
    Switch([week day]="Monday",1, [week day]="Tuesday",2, [week day]="Wednesday",3 [week day]="Thursday",4, [week day]="Friday",5, [week day]="Saturday",6 , [week day]="Sunday",7)

    2. store weekday number instead of weekday name and then calculate name when needed:
    Choose([week day], 1, "Monday", 2, "Tuesday", 3, "Wednesday", 4, "Thursday", 5, "Friday", 6, "Saturday", 7, "Sunday")

    3. regardless of which is saved, have a lookup table and include it in query used as report RecordSource
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    anlimah is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2014
    Location
    New York
    Posts
    6
    Where in query do i type expression you provided. What field name do i use for calculated field. Can you list each step for "dummie" sorry

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Expression is typed on the Field row of query builder.

    If not specified, Access will default field name to something like Expr1. Use whatever you want, maybe DayName or DayNumber.

    Access Help has more guidelines on building queries and using expressions.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    anlimah is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2014
    Location
    New York
    Posts
    6
    thank you jun 7. was able to get the sorting to my liking. I had to finagle a bit, but ultimately your suggestion worked.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Sorting By week
    By BringTheR41n in forum Reports
    Replies: 12
    Last Post: 07-14-2014, 02:57 PM
  2. Replies: 2
    Last Post: 12-31-2013, 08:19 AM
  3. Counting Days of the Week
    By losingmymind in forum Reports
    Replies: 10
    Last Post: 12-23-2013, 03:30 PM
  4. Storing Multiple Days of the Week in a Yes/No Format
    By TheMachine in forum Database Design
    Replies: 2
    Last Post: 05-14-2013, 12:46 PM
  5. How to Calculate days of the week
    By djclntn in forum Database Design
    Replies: 3
    Last Post: 02-26-2011, 11:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums