A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Need Help Calculating Percentage of Records in Certain Amount of Time



 
 
Thread Tools Display Modes
  #1  
Old February 15th, 2005, 08:43 PM
Tbird2340
external usenet poster
 
Posts: n/a
Default Need Help Calculating Percentage of Records in Certain Amount of Time

I have two date fields "DateSubmitted" (with a default value of NOW()) and
"CompletedDate" (which is a user submitted long date value). I then have a
query with a field that calculates the time it took to complete the request
which is as follows:

TimeTook: Format(Int([DateSubmitted]-[CompletedDate]),"0"" day(s)""") &
Format(Now()-[DateSubmitted],""", ""h"" hour(s), ""n"" minute(s), ""s""
seconds""")

What I want to do is calculate as a percentage the number of requests
completed within 1 hour, 4 hours, 1 day, and more then 1 day..

IE. I want the results to be similar to this:

65% requests completed within 1 hour.
20% requests completed within 4 hour.
10% requests completed within 1 day.
5% requests completed more then 1 day.

I have no idea of where to even start...

P.S. The results will be displayed on an ASP page..

Thanks for any help!


  #2  
Old February 15th, 2005, 09:00 PM
SirPoonga
external usenet poster
 
Posts: n/a
Default

Well, if oyu are going to do this in an ASP page I'd suggest creat a
totalrequests variable. Calculate that (record count, count query,
however you fancy).
Make a query for each time period (1 hour, 4 hour, 1 day, more than 1
day)

What migh be better is to use the DateDiff function.
TimeDiff: DateDiff("h", [DateSubmitted], [CompletedDate])

This will result in a time difference in hours.

Then you need 4 queries where the criteria will be
TimeDiff 1
TimeDiff = 1 and TimeDiff 4
TimeDiff = 4 and TimeDiff 24
TimeDiff = 24

Use or =, or = where needed.

For each fo those queried either use a Count or a record count and
compare to your totalresults

  #3  
Old February 15th, 2005, 09:11 PM
Tbird2340
external usenet poster
 
Posts: n/a
Default

Wow! Thanks for the reply... Any chance you can help me with the code? (if
it's not too much trouble).


  #4  
Old February 15th, 2005, 09:36 PM
SirPoonga
external usenet poster
 
Posts: n/a
Default

Eeeeks, ASP classic code or ASP.NET? I know ASP.NET without looking at
resources. I;d have to look up info for ASP classic.

Your best bet from this point is to talk to an ASP newsgroup or
htttp://www.asp.net (forum handles both ASP.NET and ASP classic).

  #5  
Old February 16th, 2005, 12:53 PM
Tbird2340
external usenet poster
 
Posts: n/a
Default

Well I'm just using Dreamweaver MX 2004 VB asp...

I thought a lot of that would be access code in queries but it doesn't sound
like it from your respsonse...

Thanks for the help..


  #6  
Old February 16th, 2005, 02:04 PM
SirPoonga
external usenet poster
 
Posts: n/a
Default

You will use queries to get the totals you need, but you will have to
figure out the percentages.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
validation of sequential numbering of records Ted New Users 5 April 20th, 2005 05:31 PM
Edit properties of linked subforms problem (repost) Allen Browne Using Forms 3 November 12th, 2004 08:16 PM
How to count the total records on a particular page Irshad Alam Setting Up & Running Reports 1 September 2nd, 2004 02:05 PM
New records can't be seen rleblanc Using Forms 6 August 14th, 2004 02:43 PM
Copying new records John General Discussion 0 June 25th, 2004 04:02 PM


All times are GMT +1. The time now is 10:27 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.