By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,395 Members | 2,524 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,395 IT Pros & Developers. It's quick & easy.

Count day of the week

P: n/a
Hi, i have an attendence database for worker. I have a query that gives
me the day that people said they were sick.

ie:
__________________________________________________ __________________

ID Name Day Status
Hours

123 Sponge Bob Monday january 1 sick
8

------------------------------------------------------------------------------------------------------------------------

I cannot change anything on the DB, just play with qry.

What i want to do, is be able to count how many mondays Sponge Bob
missed.

How to i count that??? I've changed the format of the date fiel so it
shows Monday....
Can i use that? Also i use a report.Can i do it in the report???

thx

Feb 1 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
sorry it dit not went out as i expected.

should be :

Id = 123
Name = Bob sponge
Day = monday, january 1
Status = sick
Hours : 8

Feb 1 '06 #2

P: n/a
On 1 Feb 2006 08:38:58 -0800, No***********@hotmail.com wrote:
Hi, i have an attendence database for worker. I have a query that gives
me the day that people said they were sick.

ie:
__________________________________________________ __________________

ID Name Day Status
Hours

123 Sponge Bob Monday january 1 sick
8

------------------------------------------------------------------------------------------------------------------------

I cannot change anything on the DB, just play with qry.

What i want to do, is be able to count how many mondays Sponge Bob
missed.

How to i count that??? I've changed the format of the date fiel so it
shows Monday....
Can i use that? Also i use a report.Can i do it in the report???

thx


As long as The [DateMissed] field is a Date Datatype, it's actual
format is irrelevant.

If Sunday is the first day of the week (which is the default value),
then adapt the following:

SELECT YourTable.EmployeeID, Count(Weekday([DateMissed])=2) AS
MondaysMissed
FROM YourTable
Where Weekday([DateMissed])=2
GROUP BY YourTable.EmployeeID, Weekday([DateMissed]);

Depending upon your setup you may have to add another criteria to the
above:
Where Weekday([DateMissed])=2 and Status = "Sick"
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Feb 1 '06 #3

P: n/a
Thx, i dit give it a try but not so sure about the result.

Since my qry and rpt are already done, is there sometihing i can add ,
like in the Date detail in my rpt that would count everytime its found
Monday in the Date field it would add one, i dont ming a little vba but
we are kinda restricted in a rpt.

My rpt looks like that:

ID Name

Date Hours (he is being
paid)
monday january 4 8
monday january 11 8

"The employe was sick on monday" & [dont know what to insert to count
the Monday part ] & "time"
same thing for every day of the week.....
thx a lot.

Feb 1 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.