in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

How to Average Times

Last post 11/14/2008 10:10 AM by Marc Greiner [DX-Squad]. 3 replies.
Page 1 of 1 (4 items)
Sort Posts:
Previous Next
  • 11/11/2008 7:37 PM

    How to Average Times

     Hi,

    I am retrieving response times from a SQL Datasource. There are currently in the format "hh:mm:ss", but I can change them in SQL if need be. My problem is I want to be able to drop these times into the dataarea of a PivotGrid and have it display the Average time. I've searched everwhere and tried pulling in different formats as well as trying to format the values differently, but I cannot seem to get what I want.

     

    Any ideas?  Thank you

    James Brooks

    Filed under:
  • 11/12/2008 9:03 AM In reply to

    Re: How to Average Times

    Answer
    What is the type of your "hh:mm:ss" ?
    You may need a TimeSpan instead of a DateTime, because getting the average of a date does not work, because it is not possible to add DateTimes. You could do that with TimeSpans (TimeSpans = durations).
    Marc Greiner [DX-Squad]
  • 11/13/2008 3:44 PM In reply to

    Re: How to Average Times

     Thanks Marc. that worked great. I imported the times as a timespan, averaged then, then used a custom formatter to get the right time format displayed.

    I appreciate your help.

     

    James Brooks

  • 11/14/2008 10:10 AM In reply to

    Re: How to Average Times

    Glad to know you could make it !
    Marc Greiner [DX-Squad]
Page 1 of 1 (4 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED