Access 2007 sort by day of week

J

J.Curtis

Is there a way to sort data by days of the week. For example Monday, Tues,
Wed, Thur, Fri and not alphabetically?
 
J

Jerry Whittle

Sure:

DoW: DatePart("w",[YourDateField])

1 is Sunday. If you want Monday to be first:
DoW: DatePart("w",[YourDateField],2)

Put something like above in a query and sort on it.
 
J

J.Curtis

Jerry. I am a beginner and taking on-line classes via microsoft to figure out
this program, so could you give me a few more details as to how to do this?
Maybe simplify for dumbie?
Thanks!


Jerry Whittle said:
Sure:

DoW: DatePart("w",[YourDateField])

1 is Sunday. If you want Monday to be first:
DoW: DatePart("w",[YourDateField],2)

Put something like above in a query and sort on it.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


J.Curtis said:
Is there a way to sort data by days of the week. For example Monday, Tues,
Wed, Thur, Fri and not alphabetically?
 
J

John W. Vinson

Jerry. I am a beginner and taking on-line classes via microsoft to figure out
this program, so could you give me a few more details as to how to do this?
Maybe simplify for dumbie?
Thanks!


Jerry Whittle said:
Sure:

DoW: DatePart("w",[YourDateField])

1 is Sunday. If you want Monday to be first:
DoW: DatePart("w",[YourDateField],2)

Put something like above in a query and sort on it.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


J.Curtis said:
Is there a way to sort data by days of the week. For example Monday, Tues,
Wed, Thur, Fri and not alphabetically?

Create a new Query based on your table.
In the leftmost column of the query grid type in Jerry's suggestion:

DoW: DatePart("w",[YourDateField])

Add whatever other fields you want to see.

Select "Ascending" on the Sort row of the query grid under DoW.

Open the query. It will s9ort all the Sundays together, then all the Mondays,
etc. That's what you asked for (of course it might not be exactly what you
want...)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Week number 1
Office 365 Calender 0
Buffer between projects 1
Need some PWA help 0
Logic Error on If formula 3
Sorting Multiple Tables 1
countif 1
How to implement two shifts per day with multiple teams 0

Top