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

Grouping or Subreport?

I am using MS Access 2000.

I am trying to create an Access report that lists and subtotals all the
people that have entered our department and lists and subtotals all the
people that have left our department for a given date range.
This is my query...it works.
SELECT tblMember.Lname & ", " & tblMember.Fname AS Name,
tblHistory.Date, LK_Event.Event, tblHistory.Comments

FROM LK_Event INNER JOIN (tblMember INNER JOIN tblHistory ON
tblMember.MemberID = tblHistory.MemberID) ON LK_Event.EventID =
tblHistory.EventID

WHERE ((LK_Event.Event) In ("Transferred In","Transferred Out",
"Retired - City","Retired -
Airport", "Terminated", "'Deceased"))

ORDER BY LK_Event.Event;

In the WHERE clause, I have 6 values: "Transferred In" describes
someone coming into our department.

The other 5 values describe the ways a person can leave our department.

My Problem is that I want to create an MS Access report that would
subtotal the number of people that joined our department and subtotal
the number of people that left our department and I don't know how to
group the 1 "in value" and the 5 "out values" so I can subtotal.

I would like to do this without adding any fields to the database
tables.

Is there a better approach to a solution?

Thanks
John

Mar 21 '06 #1
1 1254
John:

I would add two calculated fields to your query, something like this:
CountAsIn: IIF(LK_Event.Event like "*In",1,0)
CountAsOut: IIF(LK_Event.Event like "*In",0,1)

Then you can total these fields in your report to get the desired
numbers. WARNING: This will only work if your event descriptions
always end in the word 'In' for an incoming event. Although you said
that you didn't want to add any fields to the database, a much
preferred method would be to add a field that allows the user to
categorize an event as an incoming event when they define a new event.

HTH,
Jana

Mar 21 '06 #2

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

Similar topics

1
by: Steve Edwards | last post by:
I am trying to use an existing report as a subreport in another report. I have the subreport added to the main report, but the only thing that shows up where the subreport should be is the name of...
8
by: dixie | last post by:
I have a report with a subreport. The source object for this subreport varies according to the value of a field in a table. I am trying to programmatically set the object source for the subreport...
9
by: Downstreamer | last post by:
Design is as follows: A form for the user to input criteria to be used as the where part of the report's recordsource. This includes a multiselect list box as part of the criteria selection. ...
1
by: John | last post by:
I'm building a report where each row represents one month and its 1 to 5 weeks. A report query groups the source table date into a "month and year" expression. A subreport links to the main report...
7
by: Ellen Manning | last post by:
I've got an A2K report showing students and their costs. Student info is in the main report and costs are in a subreport for each student. The user inputs the program desired then only those...
1
by: shaqattack1992-newsgroups | last post by:
I know this is kind of a weird question, but is there anyway to give a subreport control of a main report? I posted my situation earlier about having drawings print out after a group. I have a...
5
by: Tom | last post by:
I have a subreport that can contain one or two pictures per page. The subreport is similar to an appendix to the main report. The recordsource contains a field "IncludeInReport" (Yes/No) for each...
0
by: C | last post by:
Hi, I have a main Report which has a SubReport. This SubReport also has a SubReport. I set the data of my main Report and Subreport through code DataSet dsMainReport =...
11
by: Simon | last post by:
Dear reader, The syntax for the VBA code to change the RowSource of a Master Report is: Me.RowSource = "TableOrQueryName"
3
by: Simon | last post by:
Dear reader, The syntax for the VBA code to change the RecordSource of a Master Report is: Me.RecordSource = "TableOrQueryName"
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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
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
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.