A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Summarise groups of data



 
 
Thread Tools Display Modes
  #1  
Old July 7th, 2004, 05:07 PM
damien
external usenet poster
 
Posts: n/a
Default Summarise groups of data

I've got some data which looks a bit like this:

row_id user sick day sick period
1 A 02/01/2004 1
2 A 03/01/2004 1
3 A 30/01/2004 2
4 B 02/01/2004 1
5 B 01/02/2004 1
6 B 01/03/2004 1


I need a query, or set of queries to populate the sick
period column, which has been filled out manually here, so
I can summarise by user and number of sick periods. You
can see how the rules work; periods of sickness are
grouped together.

Anyone got any ideas ?

Thanks


Damien
  #2  
Old July 7th, 2004, 10:27 PM
John Spencer (MVP)
external usenet poster
 
Posts: n/a
Default Summarise groups of data

Maybe that is clear to you, but I can't understand the rules that make Sick
Period 1 or 2 or any other number

I would think that you might be able to use a totals query and not need to fill
in Sick Period.

SELECT User, Count(SickDay) as DateCount
FROM YourTable
GROUP BY User

In the query grid, add in the User and Sick Day field
Select View: Total from the menu

In the Total row, change Group By to Count under the Sick Day Field.

damien wrote:

I've got some data which looks a bit like this:

row_id user sick day sick period
1 A 02/01/2004 1
2 A 03/01/2004 1
3 A 30/01/2004 2
4 B 02/01/2004 1
5 B 01/02/2004 1
6 B 01/03/2004 1

I need a query, or set of queries to populate the sick
period column, which has been filled out manually here, so
I can summarise by user and number of sick periods. You
can see how the rules work; periods of sickness are
grouped together.

Anyone got any ideas ?

Thanks

Damien

  #3  
Old July 8th, 2004, 10:39 AM
external usenet poster
 
Posts: n/a
Default Summarise groups of data

If the sick days are contigious, they are counted as one
sick period; ie if you have 2 days off sick in January,
next to each other, they are counted as one period. If
you then have two days off sick in February, but they are
not next to each other, eg 01/02/2004 and 28/02/2004, you
have had 4 days off sick, constituting 3 sick periods.

-----Original Message-----
Maybe that is clear to you, but I can't understand the

rules that make Sick
Period 1 or 2 or any other number

I would think that you might be able to use a totals

query and not need to fill
in Sick Period.

SELECT User, Count(SickDay) as DateCount
FROM YourTable
GROUP BY User

In the query grid, add in the User and Sick Day field
Select View: Total from the menu

In the Total row, change Group By to Count under the Sick

Day Field.

damien wrote:

I've got some data which looks a bit like this:

row_id user sick day sick period
1 A 02/01/2004 1
2 A 03/01/2004 1
3 A 30/01/2004 2
4 B 02/01/2004 1
5 B 01/02/2004 1
6 B 01/03/2004 1

I need a query, or set of queries to populate the sick
period column, which has been filled out manually here,

so
I can summarise by user and number of sick periods. You
can see how the rules work; periods of sickness are
grouped together.

Anyone got any ideas ?

Thanks

Damien

.

  #4  
Old July 9th, 2004, 02:08 AM
John Spencer (MVP)
external usenet poster
 
Posts: n/a
Default Summarise groups of data

Ok, now I understand what you want to do. Too bad, I don't know how to do what
you want. Hopefully someone else will pick up the thread and have a solution.
In the meantime, I will ponder this - probably this weekend - and see if
inspiration strikes.

I can envision a way to do this using recordsets and VBA code.

Some other question(s) for you, that could change the solution.

Does the numbering of sick periods start over at the end of the year or some
other time frame? If so, how do you count Dec 31, 1999 and Jan 1, 2000? Two
different sick periods?

Does January 31 and February 1 constitute one sick period? In other words,
consecutive days not in the same month are still one sick period.

How about sick days on Friday and Monday? Assuming that someone has sickday on
Friday and has no record of sickday on Saturday or Sunday and then has a record
of sickday on Monday.

wrote:

If the sick days are contigious, they are counted as one
sick period; ie if you have 2 days off sick in January,
next to each other, they are counted as one period. If
you then have two days off sick in February, but they are
not next to each other, eg 01/02/2004 and 28/02/2004, you
have had 4 days off sick, constituting 3 sick periods.

-----Original Message-----
Maybe that is clear to you, but I can't understand the

rules that make Sick
Period 1 or 2 or any other number

I would think that you might be able to use a totals

query and not need to fill
in Sick Period.

SELECT User, Count(SickDay) as DateCount
FROM YourTable
GROUP BY User

In the query grid, add in the User and Sick Day field
Select View: Total from the menu

In the Total row, change Group By to Count under the Sick

Day Field.

damien wrote:

I've got some data which looks a bit like this:

row_id user sick day sick period
1 A 02/01/2004 1
2 A 03/01/2004 1
3 A 30/01/2004 2
4 B 02/01/2004 1
5 B 01/02/2004 1
6 B 01/03/2004 1

I need a query, or set of queries to populate the sick
period column, which has been filled out manually here,

so
I can summarise by user and number of sick periods. You
can see how the rules work; periods of sickness are
grouped together.

Anyone got any ideas ?

Thanks

Damien

.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Struggling with MS Query... Alex General Discussion 5 July 6th, 2004 11:46 AM
Countif with 2 or more data ranges in same column Doug Worksheet Functions 1 July 4th, 2004 08:57 AM
Subreport 'pushes down' data next to it Fred Setting Up & Running Reports 3 June 30th, 2004 06:13 PM
Newbie? Do I use Report or Query John Egan New Users 11 June 28th, 2004 08:31 PM
How to graph adjacent data in column? bmacwilliams Charts and Charting 1 December 17th, 2003 12:39 AM


All times are GMT +1. The time now is 11:02 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.