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

Report totals from cross tab query

11
I've created a query in Access 2007 that looks at people who have signed up for daily shifts in one of three positions; supervisor, member or trainee. I then created a cross tab query to sum the numbers by shift by position. From here I created a report that shows by shift the total number of people who signed up for a particular position each shift. I am able to create a total of the number of people who signed up with a simple
Expand|Select|Wrap|Line Numbers
  1. =sum[trainee]
in the footer. I am trying now to total the number of shifts for each of the positions where no one has signed up. I've tried
Expand|Select|Wrap|Line Numbers
  1. =count[trainee]>0,1
below the sum calculation in the footer but it does not work. I've tried adding
Expand|Select|Wrap|Line Numbers
  1. =iif[trainee]>0,1,0
as a new box in the detail and then totaling this new in the in the footer , but get the error message that it is too complex.

This seems like one of those thing that I should be able to do, but I just can't figure out how. As always thanks in advance for your help
Aug 4 '13 #1

✓ answered by jimatqsi

Paul, what you've done with text box [TRN Calc] looks okay. I've made a similar example and got these results.
When my footer text box gets its value from =[TRN Calc] it displays the most recent value (last detail on the page) of the detail text box. When the footer text box gets its value from =Sum([TRN Calc]) I get the error you get.

Try this. Change the "Running Sum" property for your text box in the detail section. Leave the control source at =iif([trainee]=0,0,1 and that text box will begin to increment. You probably don't need that on the report, so make it invisible. Change your footer text box control source to =([TRN Calc])

That will give you what you want. Note that the Running Sum property can give you a total over a group or the whole report, as you choose.

5 2607
Rabbit
12,516 Expert Mod 8TB
None of your formulas should work. If you're calling a function, you need to surround the parameters with parentheses. Meaning that if you want to sum the column [trainee], then you need to use =sum([trainee])
Aug 4 '13 #2
Paul K
11
You are correct, it was my error in transcribing my question from my notes. The total formula that I use in the footer that works is
Expand|Select|Wrap|Line Numbers
  1. =sum([trainee])
. The formula in the footer that I get a message that it is typed incorrectly or is too complicated is
Expand|Select|Wrap|Line Numbers
  1. =count([trainee]>0)
. When I create a textbox called [TRN calc] in the detail using the control source formula of
Expand|Select|Wrap|Line Numbers
  1. =iif([trainee]=0,0,1)
and then try to sum this new textbox in the footer using
Expand|Select|Wrap|Line Numbers
  1. =sum([TRN Calc])
I get the message that it does not recognize " as a valid field name or expression. I would normally make some of these additional calculations in a query, but since I am using a crosstab query as my input for this report, I have not been able to find a way to do this through the query either.
Aug 4 '13 #3
Rabbit
12,516 Expert Mod 8TB
If you mean to get a count of how many rows have a trainee field greater than 0, then you need to embed an iif function in a sum.
Aug 5 '13 #4
jimatqsi
1,271 Expert 1GB
Paul, what you've done with text box [TRN Calc] looks okay. I've made a similar example and got these results.
When my footer text box gets its value from =[TRN Calc] it displays the most recent value (last detail on the page) of the detail text box. When the footer text box gets its value from =Sum([TRN Calc]) I get the error you get.

Try this. Change the "Running Sum" property for your text box in the detail section. Leave the control source at =iif([trainee]=0,0,1 and that text box will begin to increment. You probably don't need that on the report, so make it invisible. Change your footer text box control source to =([TRN Calc])

That will give you what you want. Note that the Running Sum property can give you a total over a group or the whole report, as you choose.
Aug 5 '13 #5
zmbd
5,501 Expert Mod 4TB
Paul K:
You might want to add Allen Browne's site to your bookmarks as there are several usefull tips and explanations on his site.
Related to your issue with CTQ his tips are here:Crosstab query techniques
Aug 5 '13 #6

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

Similar topics

8
by: Donna Sabol | last post by:
First, I should start by saying I am creating a database to be used by some very impatient, non-computer literate people. It needs to be seameless in it's operation from their point of view. I...
1
by: Kissi5559 | last post by:
Hello, Can any one help me with the syntax to calculate the totals of a field? There are three fields in the query; which contains the data "O" or "T", the other which contains (total lines of...
3
by: Artur | last post by:
I need access table as a result of cross query? What should I do? Artur
18
by: simonmarkjones | last post by:
Hi all, I create a report to act as a receipt to customers. The report displays all the customer payment details and then i print this. This works fine. However, i now want to add some more...
6
by: ontherun | last post by:
hi, i am a newbie in access and i created a database which is between client and job. the job fields consists of more than 100 fields. i could not split the fields as the relationship is 1-to1....
2
by: Tom | last post by:
All: I have a report that lists quantities of stuff used over the course of a year and it is grouped on each month. In the group footer I want to insert the total for the month - easy stuff so...
3
by: tyrynn28 | last post by:
My query looks like this: ID Docs 1 A 1 B 1 C 2 A 2 C My report looks like this: ID Docs 1
5
by: Ian Brown | last post by:
Hi, this is my first post on this site, so my apologies if I have done this wrong. I'll also apologise for my spelling as I'm dyslexic. I'm having a problem with a Report from my database. I have...
11
by: =?Utf-8?B?cmtibmFpcg==?= | last post by:
How can I stop receiving this message while calling a crystal report? "The report you requested requires further information." Thanks
7
govnah
by: govnah | last post by:
Hi mighty fine people, I have a report with two sub-reports attached. The Main report calculates the totals of the two sub-reports. The problem i am having is that when i open the report, it...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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: 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: 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...

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.