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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
Wow! Thanks for the reply... Any chance you can help me with the code? (if
it's not too much trouble). |
#4
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
You will use queries to get the totals you need, but you will have to
figure out the percentages. |
Thread Tools | |
Display Modes | |
|
|
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 |