473,473 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Can't get a report total and % to work when dates are made variable in query

20 New Member
Created a report in Access where each record has two checkboxes "FIM Incomplete" and "FIMInaccurate". Have been able to create totals and percentages at bottom of report for each. However, once I alter the query to require the user to enter a start date and end date for the period of time the information is desired, the expressions at the bottom of the report result in "error". What needs correction to allow for this variable? Currently, the expressions are:

=DCount("FIMInaccurate","Period Query","FIMInaccurate=Yes")

=(DCount("FIMInaccurate","Period Query","FIMInaccurate = yes"))/(DCount("FIMInaccurate","Sr Metrix Period Query"))

I'm not a programmer (wish I was and knew a whole lot more about syntax) so any help would be very appreciated.
Jul 19 '10 #1
7 1250
mseo
181 New Member
hi, cambar
Welcome to bytes
you can post your sql of this report in here
and if you want to count the checked checkboxes in your report you can do simple way put text box in the group footer and put something like this
=Sum([your checkbox control name])*-1
this way you can count the checked checkboxes

p.s the startdate and enddate are parameters in queries and parameters are Parallel Variable in VBA code
you can add checkbox parameter as well in whatever, your form or report based on query but this will be a bit different if you do this within a form
hope this helps
Jul 19 '10 #2
cambar
20 New Member
@mseo
Thank you for the option you provided. How do I then obtain the percentages using this approach?
Jul 19 '10 #3
mseo
181 New Member
please post your sql statement of your report and if you can attach snapshot of your report that would help us understand your problem properly
Jul 19 '10 #4
cambar
20 New Member
@mseo
For proprietary reasons, cannot post copy of report. Let me try one more time to explain. The query I developed for the report in question has a date field. In this date field, the criteria requires the user to input the time period (dates) for which the report information is desired Example: Between[Enter Start Date:]And [Enter End Date:] When the report prints out, I would like to be able to total two of the columns which are checkboxes. Your response for summing these columns worked great. However, I also need to determine the percentage of -1 responses as compared against total column responses. The expression I initially posted which was placed in the report footer provided this information as long as the date field criteria was left blank or was filled with an actual date in the query. When it was filled with the criteria "Between...." the expression in the report would no longer work. Since your expression worked well in providing the addition of the checkboxes, I am only seeking to know how I can adjust it to provide the percentage. Thank you for your help.
Jul 19 '10 #5
mseo
181 New Member
ok,
if I understand your question correctly, you want to view the percentage of the checked checkboxes to the total of records, if that right
you can put textbox and set it invisible to count all the checkboxes using =Count([checkbox field name])
then put textbox to view the percentage and set its format to percent = NZ((name of text box that count the checked checkboxes)/(name of textbox that counts all the checkbox),0)

if it doesn't work as expected, let me know
hope this helps
Jul 19 '10 #6
cambar
20 New Member
Thanks for the help. This worked out very well.
Jul 20 '10 #7
mseo
181 New Member
@cambar
you are welcome cambar
Welcome to bytes again
glad we could help
Jul 20 '10 #8

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

Similar topics

1
by: Joe | last post by:
Hi, I've got 2 table variables inside of an SQL 2000 function: @tmpBigList(BItemID, BRank) @tmpSmallList (ItemID, Rank) The following UPDATE statement can run for a long time if @TmpTable1 has...
2
by: Sam | last post by:
Hello everyone, I have a table, which contains a picture column, I put URL info into it. "www.myweb.com/1.jpg..." I want to show this picture in my crystal report, I find some samples show the...
7
by: Egor Shipovalov | last post by:
I'm implementing paging through search results using cursors. Is there a better way to know total number of rows under a cursor than running a separate COUNT(*) query? I think PostgreSQL is bound...
1
by: Michael DeLawter | last post by:
Using Access 2002. I have a chart in a report that is currently based on a query in which the user enters the start and end date for the chart to display. Both the start and end dates have been...
10
by: Lyle Fairfield | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaac11/html/acfctNZ_HV05186465.asp "If the value of the variant argument is Null, the Nz function returns the number zero or a...
4
by: mukeshhtrivedi | last post by:
I have TYPE field which has 3 data like HEAD, TRACK and PANEL. Now whenever any person works on HEAD we put 8 Hrs in HRS filed and in LABOR field it reflects the dollar value automatically like...
2
by: modfreq | last post by:
Hi, I am fairly new to Access and VBA. I have found a few threads relating to my problem, but none have led to a solution, so if I hope that I am not restating an old question... I am writing...
5
by: iheartvba | last post by:
Hi I am getting the following error when i click cmdFFR (See note1): Invalid SQL statement, expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT' or 'UPDATE'. I can't figure out why this is. Spelling...
25
by: DanicaDear | last post by:
Hello again Bytes...I missed you! First, background: In a hotstick lab, we ship orders every two years. We ship a new order and the customer uses the new box to return the previous year's order....
1
by: indikamaligaspe | last post by:
Hi all, I am trying to get a PL/TCL trigger to update an audit table working. The problem is when I create the trigger on an exiting table, I get the following error "ERROR: can't read...
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
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...
1
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
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
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.