Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Can I include/not include sums in Access Reports based on dates?

Posted on 2011-02-24
7
Medium Priority
?
206 Views
Last Modified: 2012-05-11
I have a report designed so it shows issued policies within 0-15 days of the renewal date, same for 16-30 and 31-60 days and also for anything greater than 60 days.

All total numbers are correct, however, if I was to say that I only want to see figures in relation to the dates I put in how would I go about it? Currently if I put from the 1st Feb to the 28th Feb it will still show the total figure for anything greater than 60 days and total up the policy count which therefore gives a slightly inaccurate figure.

The query is as shown below, (bear in mind there are two further queries created before this):

SELECT qry_contract_certainty_average.CountOfcontract_certainty_time, qry_contract_certainty_average.AvgOfcontract_certainty_time, qry_contract_certainty_average.SumOfNegative, qry_contract_certainty_average.[SumOf0-15 days], qry_contract_certainty_average.[SumOf16-30 days], qry_contract_certainty_average.[SumOf31-60 days], qry_contract_certainty_average.[SumOf>60 days], qry_contract_certainty_average.CountOfInsurer_Docs_issued1, [CountOfInsurer_Docs_issued1]-[CountOfcontract_certainty_time] AS Expr2, ([SumOf16-30 days]+[SumOf0-15 days]+[SumOfNegative])/([CountOfInsurer_Docs_issued1]) AS Expr3
FROM qry_contract_certainty_average;

So the dates are text fields that are placed in the form where the user enters in the dates and the report will take those dates and use the renewal date field to show records only between those dates.

Any advice or direction would be much appreciated, thanks.
0
Comment
Question by:josefmikhail2011
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 34968900
Typically you would add a WHERE clause like this, if the RenewalDate has no time portion:

WHERE RenewalDate Between Forms![FormName]![StartDate] And Forms![FormName]![EndDate]
0
 

Author Comment

by:josefmikhail2011
ID: 34968951
The Where clause already exists in the first query I created, second query then uses the first and the third query as shown in my original post uses the second.

I just need to get the query to say if difference in the dates entered is greater than 60 do include the number in the total policy count.  If difference is 60 or less then do not include in policy count.

Could I do anything with the report itself?
0
 
LVL 40

Accepted Solution

by:
als315 earned 2000 total points
ID: 34969718
You can use "On format" event in report sections and set some fields to be invisible:
if DatesDifference < 31 then Me.[Sumof31-60].visible = false
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 

Author Comment

by:josefmikhail2011
ID: 34970089
That would not make the field visible and still count the figure included in the total, I want to avoid this by getting the report not to include the sum of anything greater than 60 days.
0
 
LVL 40

Assisted Solution

by:als315
als315 earned 2000 total points
ID: 34970563
If you are using SUM in report, you can add IIF in equation.
0
 
LVL 71

Expert Comment

by:Qlemo
ID: 36032360
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question