473,406 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

I'm rusty on my Access...can anyone help with a Query question?

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
Nov 12 '05 #1
3 1352
On Wed, 17 Dec 2003 05:31:36 GMT, Casper's Friend wrote:
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?


If DAY is based on a date field you could just duplicate the field, format
it to "w" and sort by this field:

No: Format(YourDate,"w")
DAY: Format(YourDate,"ddd")

(simplified, you certainly have to consider the parameters FirstDayOfWeek
and FirstWeekOfYear, dependent on your region.)

If it is a literal, you'll have to go the way you described, but Switch
would be the function:

No: Switch([Day]="Mon",1,[Day]="Tue",2,[Day]="Wed",3,[Day]="Thu",4,
[Day]="Fri",5,[Day]="Sat",6,[Day]="Sun",7)

Peter

--
No mails please.
Nov 12 '05 #2
You can get the value of a day using the weekday() function. Supply a
date and the day of the week that you wish to use as the firstday.

To sort the records in your query,
You could format the date field as Format(Date,"yyyymmdd") and sort
asc.

"Casper's Friend" <my**********@yahoo.com> wrote in message news:<YS********************@twister.austin.rr.com >...
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

Nov 12 '05 #3
Ed
"Casper's Friend" <my**********@yahoo.com> wrote in message news:<YS********************@twister.austin.rr.com >...
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


Looks like your solution using a numeric value for Day should work.
ET
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Joris Kempen | last post by:
Hi people, I know that the question has come around sometimes: How to open an Access Report using ASP and export it to for example RTF. I'm trying to implement the first method of David...
14
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB...
3
by: Jon Ole Hedne | last post by:
My Access 2002-application need to work with tables from both Oracle and Access. To solve this, I want to run some querys on three views in Oracle and import the results into temporary...
1
by: Andrew McNab | last post by:
Hi folks, I have a problem with an MS Access SQL query which is being used in an Access Report, and am wondering if anyone can help. Basically, my query (shown below) gets some records from a...
5
by: Bec | last post by:
I'm in desperate need of your help.. I need to build an access database and have NO idea how to do this.. Not even where to start.. It IS for school, and am not asking anyone to do my...
9
by: Fish Womper | last post by:
I am at best a part time developer of Access databases. I use Access 2.0, as this is all my employer has on its computers. Even so, to use this ancient version requires a fairly convoluted...
3
by: David Hearn | last post by:
I've been doing ASP.NET for the past few years and have gotten spoiled and now find myself in a situation where I need to make some changes to an old classic ASP page. The problem is that there is...
16
by: JoeW | last post by:
I'm utilizing a database that I created within MS Access within a program I've created in VB.NET. I am using the VB front end to navigate the information, but want to be able to print a report,...
13
by: Jack B | last post by:
I'm using Access 2002 to create a database for a small opera company that my wife is involved in, and I'm more than a bit rusty because I haven't created a new Access database since about 1999. ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.