Friday, 15 August 2014

vba - Average Time between Two Date Fields in MySQL? -


I am working on a MySQL database which tracks call center phone contacts. Phone Agents have put call information with an access application, and I am generating a report based on that information, either in Entry or Excel VBA

Information about contact, and every contact with the 'ContactDateTimeInitiate' and 'ContactDateTimeComplete' date fields is saved in the contact table. There are fields in the record for the type of the call, and I have to pull information based on a few different ideas. For example, for a category, one for the department, for the month, for the day, etc.

My question is, how can I generate average (compressed time-complex-datadetinetit)? I did this by using several disks using some disabled loop, but I'm sure there is an easy way to do this.

It is refunding a number in hundreds - it should be close to 5 or 10 minutes:

rst.Open "avg (timedif (contactdatetimecomplete, contactdatimeinitiate)) from expr1 Contact as ", CNN, Adopenstatic, AdLockbackOptimicic

I am connecting with DB. Okay, the issue is in the SQL syntax. I can not find anything else from there. Is anyone able to help?

Try this:

  SELECT AVG (TIMESTAMPDIFF (second, contact data TimeNinetate, ContactDataCom Complaint)) As an average   

This should give you average contact length in seconds.

If you are really worried about partial-second intervals, then you try to use MICROSECOND instead of SECOND You can. In this case you will need

  SELECT AVG (0.000001 * TIMESTAMPDIFF (microsoft, contact time period, contact date time format) as the average   

This answer is valid for MySQL.

No comments:

Post a Comment