Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to display elapsed time in several fields

Status
Not open for further replies.

mdaniele

Technical User
Joined
Sep 18, 2003
Messages
20
Location
US
I'm trying to display the elapsed time in days and minutes for the response to a call. On my form, I have a date received field and a time received field (they're not combined into one field because the data is entered from hardcopy at a later time), and a DateCompleted field and a TimeCompleted field. I have created two fields (Days and Mins)to show the elapsed processing time. I use the typical Datediff formula to calculate the elapsed days and mins between the Recieved Date and Time to the Completed Date and time. There problem is:
1. The minutes total sometimes shows a negative value (for instance if the time recieved was 12:30am and the time completed was 11:30am the following day.

I would prefer to display 3 fields Days, Hours, Mins and any help or suggestions on how to arrive at that result would also be appreciated. Thanks.

...and when Satan lividly demanded to know why the old man did not exhibit any fear whatsoever of him, the 82 year old man calmly replied "why hell, you ain't so bad, I've been married to your sister for over 50 years"
 
Have you tried using datediff("n", begindate, enddate) to get the difference in minutes. Then calculate the days/hours/mins as three separate fields from the # of minutes difference.



 
Sounds simple enough, but currently my ReceiveDate/CompleteDate fields only contain the date (sans time)and I use
=DateDiff("d",[DateIssueReceived],[DateCompleted])
to capture the days. The minutes are captured in the [ReceivedTime] and [CompleteTime] fields, which contain the time (sans date) and I use
=DateDiff("n",[TimeRec],[TimeComp])
to capture the minutes. So the fields aren't defined as a single field (intentionally)

In order to use your proposed solution, will I have to concantinate the [ReceiveDate] and [ReceivedTime] field to come up with the full [Begindate] and the do the same with the [CompleteDate] and [CompleteTime] fields to come up with the full [EndDate]? and then apply your formula.

If so, can you suggest the formula/syntax?

...and when Satan lividly demanded to know why the old man did not exhibit any fear whatsoever of him, the 82 year old man calmly replied "why hell, you ain't so bad, I've been married to your sister for over 50 years"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top