Results 1 to 5 of 5

Thread: Average Function?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2011
    Posts
    3

    Average Function?

    Hello all,

    I'm having a problem creating a function for calculating an average. I need to divide the sum of a column of integers by the number of rows in that column. These integers are generated by a datediff command and their values are assigned to textboxes in a report. The results can only be whole numbers, no decimal points.

    I'm pretty new to this so if this is an obvious question please excuse my ignorance. If you need any more information to address my question please let me know.

    Thanks for the help.

  2. #2
    PowerPoster make me rain's Avatar
    Join Date
    Sep 2008
    Location
    india/Hubli
    Posts
    2,208

    Re: Average Function?

    ************ WELCOME **************

    answer is there in your quote it self

    Code:
    I need to divide the sum of a column of integers by the number of rows in that column. These integers are generated b
    but sum(which colums ) / sum(which rows)
    is it a datagrid view ?
    Database table
    Data table
    The averted nuclear war
    My notes:

    PrOtect your PC. MSDN Functions .OOP LINUX forum
    .LINQ LINQ videous
    If some one helps you please rate them with out fail , forum doesn't expects any thing other than this

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2011
    Posts
    3

    Re: Average Function?

    It is in database table, but I'm writing the logic in VS because alot of the values in the report are calculated in VS rather than SQL. I was thinking something like SUM(columnname)\COUNT(rows in that column). But the number of rows fluctuates because the user can narrow results by dates.

  4. #4
    PowerPoster make me rain's Avatar
    Join Date
    Sep 2008
    Location
    india/Hubli
    Posts
    2,208

    Re: Average Function?

    Code:
    values in the report, U mean report viewer or crystal reports
    if it is crystal reports then i can't, i never worked in crystal reports
    if u want the code to calculate the average of the number of columns / returned rows
    Ok i can
    The averted nuclear war
    My notes:

    PrOtect your PC. MSDN Functions .OOP LINUX forum
    .LINQ LINQ videous
    If some one helps you please rate them with out fail , forum doesn't expects any thing other than this

  5. #5

    Thread Starter
    New Member
    Join Date
    Jun 2011
    Posts
    3

    Re: Average Function?

    It's in report viewer and not crystal reports.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width