Solved

Display count of days in report (Access2007)

Posted on 2009-04-06
14
864 Views
Last Modified: 2013-11-28
Hi experts,

I have a form where I input two dates and click a command button that opens up a report. By inputting start and end date in the form, records by that date in the corresponding table is displayed in the report by a query. This works fine. I have put a count in the report that totals the number of records that is displayed. However, in the same report I need to divide the number of records by the number of days I have inputted in the form, and display the result in percentage.

Can anyone suggest me how I can solve this?

Best regards,

Stayer



0
Comment
Question by:Stayer
[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
  • 5
  • 2
14 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24083525
Based on the form I helped you with previously there was no:

 "number of days I have inputted in the form"

But if there was/is, it should be relatively simple.

New sample using USA date format (March 2009)

;-)
JeffCoachman

Access-EEQ-24288336-24299637Coun.mdb
0
 

Author Comment

by:Stayer
ID: 24085676
This works very good!

However, I need to learn how to input the mathematical expressions myself. Is there any guidelines anywhere as to using mathemaitcal expressions in reports or anywhere in the design view toolbar where there is a math - wizard etc.

Best regards,

Stayer
0
 

Author Comment

by:Stayer
ID: 24085770
Hi again,

Also I see in the provided sample that I manually have to input the number of days (sorry for being unclear on this). I need it to automatically calculate the number of days between the start and end - date (do not have to display this).

rgds,

Stayer
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24086199
"I need to learn how to input the mathematical expressions myself. "
What are you calling an "expression".

You asked for the percent.
This is what the sample calculated in the report.
Please clarify.

"Also I see in the provided sample that I manually have to input the number of days"
That is what the sample does.
You enter the date range, then you enter the number of days (There are three textboxes)

If either of these is not correct, then can you explain exactly how you want this system to operate, step by step?

Jeff
0
 

Author Comment

by:Stayer
ID: 24089653
Hi,

By expression I mean common mathematical operators such as +, -, /  and *. After I have returned a count from a query I would like to, lets say,, divide it with another count from a different query (which also returns a result to the same report). However, the result of this should be displayed in percentage.

How may I write this "expression" in a report?

Rgd manually having to input the number of days: I would like to only input two dates (date range) and based on this  the computer should automatically count how many days it is btw the start and end date (no manually input).

rgds,

Stayer
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24090381
But again, you asked for the percentage which is:
n/m

So I am still a little confused about why you would need other expressions.

Again, can you clearly state exactly how you want this system to function, step by step.

In other words, please explain, in detail, what my sample does not do, that you want it to do.

Note: Please spell out obscure abbreviations.
I have no idea what "Rgd manually..." means

I also no not know what  you mean by : ("btw")
BTW is the abreviation for "By The Way" , not "Between".

Thanks

JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24090457
I think we are having a communications issue here, so let's start over.

Pleas explain *EXACTLY* how you need this system fo function step by step.

1. User opens the form.
2. User types in two dates.
3. User clicks a button and a report displays the number of days between the two dates in the Report footer.
4. ...ect
0
 

Author Comment

by:Stayer
ID: 24090724
Hi boaq2000,

ok, this is what I`m looking for:

1. user opens form
2. user types in two dates
3. user clicks a command button, for instance View Report, and a report is displayed
4. in the report, I would like three things to be displayed
   a) the number of days between the two dates
   b) the number of records (I am not so interested in seeing the records connected to the dates)
  c) percentage share, i.e:   (# of records / # of days) = ..... %

Hopefully, this clarifies a little bit.

Best regards,

Stayer
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 24093029
Try this:

JeffCoachman
Access-EEQ-24288336-24299637Coun.mdb
0
 

Author Comment

by:Stayer
ID: 24094810
Hi boaq2000,

this was exactly what I was looking for!

thank you very much!
0
 

Expert Comment

by:ejpren
ID: 34157303
This solution helped me as well.   Odd that the button wizard does not insert the correct command to open a report.  - Thanks, boaq2000!
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34157483
ejpren,

The Button wizard in Access 2007 and newer will insert a "Macro" to open a report.
In Access 2003 and older, in used VBA code.

The Button Wizard is designed to be very basic, so it will only open a Report.
It will not accept Filter criteria.

;-)

JeffCoachman
0
 

Expert Comment

by:ejpren
ID: 34180367
I used the button wizard to create a button to open a pre-defined report.  It does not work.  I downloaded boaq2000's database and used his command for his button onclick event for my button, and now it works.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34183957
OK

The button wizard should have worked, just try running the compact/repair utilityand see if the button wizard will work
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

726 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