473,405 Members | 2,261 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,405 software developers and data experts.

Noob having problems joining two queries in one report Access 2007

17
I have this Report that displays information based on someone selecting a Start Date and End Date.

The Table is: MSys_obj These are its fields: Incoming/Outgoing,Date,Worker,Caller,Sex,
Time,Duration,Location,Reason,Satisfaction,A,B,C,D ,E,Outcome

And this is its Query (Usysqry_Smiley):

PARAMETERS [Start Date] DateTime, [End Date] DateTime;
SELECT MSys_obj.Date, MSys_obj.Location, MSys_obj.[Incoming/Outgoing], MSys_obj.Duration, MSys_obj.Satisfaction, MSys_obj.A, MSys_obj.B, MSys_obj.C, MSys_obj.D, MSys_obj.E
FROM MSys_obj
WHERE (((MSys_obj.Date) Between [Start Date] And [End Date]));

I now wish to make the report automatically display a breakdown of the number of calls in each of three different segments during the six hour work shift.

This is its Query (Usysqry_Hours):

SELECT "4:30 PM TO 6:29 PM" AS TimeCalc, Count(Q.Time) AS TotalCalls
FROM MSys_obj
WHERE Q.Time >=#4:30 PM#
AND Q.Time <=#6:29 PM#
UNION
SELECT "6:30 PM TO 8:29 PM" AS TimeCalc, Count(Q.Time) AS TotalCalls
FROM MSys_obj
WHERE Q.Time >=#6:30 PM#
AND Q.Time <=#8:30 PM#
UNION SELECT "8:30 PM TO 10:30 PM" AS TimeCalc, Count(Q.Time) AS TotalCalls
FROM MSys_obj
WHERE Q.Time>= #8:30 PM#
AND Q.Time <=#10:30 PM#;

I don't know if this is the correct SQL, or how to make the UNION function work. Nor do I know what formula to place in the Report Footer to display the following additional information in the report to make it also display:

4:30 to 6:29: (count of hours)
6:30 to 8:28: (count of hours)
8:30 to 10:30 (count of hours)

Any ideas as to what I'm doing wrong?
Oct 12 '13 #1
0 1197

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: Neil | last post by:
I posted a few days ago that it seems to me that the Access 2007 rich text feature does not support: a) full text justification; b) programmatic manipulation. I was hoping that someone might...
2
by: ARC | last post by:
Just curious if anyone is having issues with Acc 2007 once the number of objects and complexity increases? I have a fairly large app, with many linked tables, 100's of forms, queries, reports, and...
5
by: LadyIlsebet | last post by:
I'm not a fantastic Access developer, but I'm trying to help get Inventory and whatnot organized at work. They are used to 5 year budget plans that list out exactly what has to be purchased what...
5
by: WPW07 | last post by:
Hello, We have several complex applications developed in Access 2003 by various outside consultants. These applications link to a variety of Oracle tables and are used only for Access reports. ...
1
kmartinenko
by: kmartinenko | last post by:
Hello all, My system was recently "upgraded" to MS Office 2007 and now I am having a really frustrating time trying to get my simple command button to open a query. This is the same database I...
7
by: preeny8 | last post by:
Hi there, I recently updated to Access 2007, and I'm getting a couple of errors that i'm not sure how to deal with. I worked with a lot of databases in Access 2003 (.mdb), and for some reason...
9
by: prakashwadhwani | last post by:
Hi !! I'm about to develop a new project for a client. Should I go about it in Access 2003 or 2007 ? Purchasing it either for me or for my client is not a major consideration here ... what I'd...
4
by: Tennotrumps | last post by:
I am trying to export a report to excel but the "excel" option is greyed out. I can export the query the report is based on, but not the report. However, if I open the database on another PC I...
5
by: Scorp Scorp | last post by:
Dear All, I joined newly to Bytes :) Am stuck in the following issue like a week, and couldent find proper fix :( I ll try to breif: I have a recordset, of record count over 4000 records....
7
by: Scorp Scorp | last post by:
Dear all Am trying to put the following query in a report SELECT color, sum(qty*u.p) as total FROM table WHERE flag = "00" GROUP BY color couldnt set the fillter
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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.