I'm rusty on my Access knowledge, can anyone help me with my Query question?

C

Casper's Friend

It's been a while since I've had to build anything in Access, so forgive me
if this is simple...I'm probably just having quite the mental block here.

I have a fairly simply query...3 fields which are just grouping and
counting....my fields are:
Day / #of Files / # of Days(this month) - which I would like to read like :
MON / 64 / 3
TUE / 64 / 2
WED / 38 / 2
THU / 49 / 2
FRI / 50 / 2
SAT / 25 / 2
SUN / 25 / 2

I would simply like to sort by the day of the week - Monday thru
Sunday....however my query is wanting to alphabetize the MON thru SUN
instead of putting it in daily order. Is there anyway to override this and
tell it that I want it to go MON, TUE,...etc? I also thought that I could
put another field on the query that would read the data (DAY) and covert it
into a value that I could sort by....ie... If DAY="MON" then 1, If DAY =
"TUE" then 2, etc... is this possible?

Sincerely,

A frustrated Casper's Friend :p
 
G

Gary Walter

Hi Casper,

Is [Day] the result of formatting a Date/Time field?
(I might change name to something other since
"Day" is a vb function)

If so, then you could just also use the "WeekDay" function
against that Date/Time field in the query and sort
on the result.

Else, if you have a table with a field "Day,"
then one might use the Switch function:

Switch([Day]='MON', 1, [Day]='TUE', 2, [Day]='WED', 3, [Day]='THU', 4, [Day]='FRI',
5, [Day]='SAT', 6, TRUE, 7)

If these don't work, please post your query
and the table structure.

Thanks,

Gary Walter
 

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


Top