473,394 Members | 1,751 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,394 software developers and data experts.

Query Puzzle Access 2000

Hi all,

I have a query at the moment which shows what people have been doing on
a certain department throughout an entire shift. It shows the start (Min)
time and end (Max) time and then shows total time doing the job. I have now
been asked if I can get it to show what they have been doing hour by hour.

so the format would need to be something along the lines of :

Date Start End Forname Surname Login Ctns Diff
06/02/04 06:00 06:59 Sam Smith 38965 26 0:59
06/02/04 07:00 07:59 Sam Smith 38965 35 0:59
06/02/04 08:00 08:59 Sam Smith 38965 32 0:59

Can anyone shed any light on the best way of doing this?

Cheers,

Mark
Nov 12 '05 #1
3 1536
How about using the query as the record source for a report, and do a
group on the time field by hour?

-Paul

"Mark Reed" <ma*********@ntlworld.com> wrote in message news:<1V*************@newsfep1-gui.server.ntli.net>...
Hi all,

I have a query at the moment which shows what people have been doing on
a certain department throughout an entire shift. It shows the start (Min)
time and end (Max) time and then shows total time doing the job. I have now
been asked if I can get it to show what they have been doing hour by hour.

so the format would need to be something along the lines of :

Date Start End Forname Surname Login Ctns Diff
06/02/04 06:00 06:59 Sam Smith 38965 26 0:59
06/02/04 07:00 07:59 Sam Smith 38965 35 0:59
06/02/04 08:00 08:59 Sam Smith 38965 32 0:59

Can anyone shed any light on the best way of doing this?

Cheers,

Mark

Nov 12 '05 #2
Mark Reed wrote:
Hi all,

I have a query at the moment which shows what people have been doing on
a certain department throughout an entire shift. It shows the start (Min)
time and end (Max) time and then shows total time doing the job. I have now
been asked if I can get it to show what they have been doing hour by hour.

so the format would need to be something along the lines of :

Date Start End Forname Surname Login Ctns Diff
06/02/04 06:00 06:59 Sam Smith 38965 26 0:59
06/02/04 07:00 07:59 Sam Smith 38965 35 0:59
06/02/04 08:00 08:59 Sam Smith 38965 32 0:59

Can anyone shed any light on the best way of doing this?


Maybe, maybe not. I will assume that each ctns has a date/time stamp on it.
If so, I would be grouping the values by Login, date, Hour. IOW, add 2 more
columns to group by.
GroupHour:Format(DateTimeField,"h")

The reason to group by date is if people work a second or third shift and hours
go across a day.

The only problem would be the start time for the first record. You could group
also on the Max time and Min time for each hour....I bring this up because a
person may start late, leave early, have a power outage, etc.

Nov 12 '05 #3
Thanks for the advice,
I have managed to do this by adding the following field to my query
DatePart("h",[time]) AS hr

I have then created another table with 2 fields..... Date part and Time
period.

The data looks something like

Date part Time period
0 00:00 - 01:00
1 01:00 - 02:00

I have then created another query from the first query and the new table,
then linked them by the datepart.

the result gives the a time period of activity along with the start and end
time within that period then the sum of Ctns and the total time worked
within that hour.

Mark

"Salad" <oi*@vinegar.com> wrote in message
news:40**************@vinegar.com...
Mark Reed wrote:
Hi all,

I have a query at the moment which shows what people have been doing on a certain department throughout an entire shift. It shows the start (Min) time and end (Max) time and then shows total time doing the job. I have now been asked if I can get it to show what they have been doing hour by hour.
so the format would need to be something along the lines of :

Date Start End Forname Surname Login Ctns Diff
06/02/04 06:00 06:59 Sam Smith 38965 26 0:59
06/02/04 07:00 07:59 Sam Smith 38965 35 0:59
06/02/04 08:00 08:59 Sam Smith 38965 32 0:59

Can anyone shed any light on the best way of doing this?
Maybe, maybe not. I will assume that each ctns has a date/time stamp on

it. If so, I would be grouping the values by Login, date, Hour. IOW, add 2 more columns to group by.
GroupHour:Format(DateTimeField,"h")

The reason to group by date is if people work a second or third shift and hours go across a day.

The only problem would be the start time for the first record. You could group also on the Max time and Min time for each hour....I bring this up because a person may start late, leave early, have a power outage, etc.

Nov 12 '05 #4

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

Similar topics

11
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
5
by: Ken Lindner | last post by:
We have a report based on a query that is called from a form. Nothing too special here. The query has 3 coulmns that are populated directly from values entered into entry fields on the form...
8
by: Adam Louis | last post by:
I would like help resolving this problem. I'm a novice who's been hired to query a hospital database and extract useful information, available to me only in a dynamically generated, downloadable...
1
by: Stefan V. | last post by:
Hello! I am trying to convert a query written for SQL Server 2000 database tables, to a MS Access query. Here is what I have in SQL Server: SELECT t2.*, CASE WHEN t2.QType = '3' THEN...
0
by: LesM | last post by:
This is a change of behaviour between Access 2000 SP3 and Access 2002 SP3. I have Progress table that is linked via ODBC into Access using OpenLink Lite for Progress 9.0b. For over a year, using...
12
by: Joe Stanton | last post by:
Hello Group I have a query that works in Oracle and SQL Server, but fails in Microsoft Access. The query is: SELECT data fromTABLE1 WHERE data>='A&' AND data<'A''' Here is my sample data:
12
by: Bookreader | last post by:
I tried Googling this but I get a whole lot of replies about running the SQL statement in VB via ADO. All I want to do is run an existing ACCESS 2000 query from VB with no information returned...
2
by: ILCSP | last post by:
Hello, I'm in the process of changing our 'normal' Access 2000 update queries to Update Pass Through Queries. We have a SQL server 2000 database and we're using an Access 2000 database as our...
2
by: ILCSP | last post by:
Hello again, I'm still in the process of changing ms access queries to Pass through queries. We're using a SQL Server 2000 database with an Access 2000 DB as our front end. I trying to convert...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.