Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting Date in Alpha Order By Day (ie. Mon., Tues.) 1

Status
Not open for further replies.

bethabernathy

Programmer
Jul 13, 2001
254
MX
Hi - I am using a query with this syntax:

DayOfWeek: Format([Date],"ddd") to return results by the day of the Week ie Monday, Tuesday, etc. I can't seem to get the results to sort in alphanumeric order. I just want the days to report out logically. What I am getting is Friday first, Monday second, etc.

Is there something I can do to get a logical sort.

Thanks, Beth beth@integratedresourcemgmt.com
 
Hi Beth,
Try using the Weekday function to get the number for the day of the week.

=Weekday(#date col#)

Sunday date returns 1
Saturday date returns 7

Hope this helps
 
Hi - I am trying this in my query:

Weekday: Format([Date],"ddd")

and I am still not getting the sorting to work. If I use this:

Weekday: ([Date])

This sorts correctly displaying this type of date:

Sunday, November 25, 2001
Monday, November 26, 2001

And what I want to display is just:

Sunday
Monday
Tuesday

etc.

Perhaps if I build another query off of this one parsing out anything after the "," and then use that for my report?

Thanks, Beth beth@integratedresourcemgmt.com
 
Try to format the date column with this:

Weekday: Format([Date],"w")

This will give you the day of the week also.
 
Hi John - Thanks that does work, but then how do I get the actual Day ie Monday to appear on the report?

Thanks, Beth beth@integratedresourcemgmt.com
 
Create a different column in the query.

DayofWeek: Format([Date],"dddd") {for long names}

Or
DayofWeek: Format([Date],"ddd") {for short names}
 
AWESOME!!! Just Perfect. Thank You John! beth@integratedresourcemgmt.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top