|
-
Jun 28th, 2011, 10:06 AM
#1
Thread Starter
New Member
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.
-
Jun 28th, 2011, 10:17 AM
#2
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
-
Jun 28th, 2011, 10:25 AM
#3
Thread Starter
New Member
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.
-
Jun 28th, 2011, 11:11 AM
#4
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
-
Jun 28th, 2011, 11:38 AM
#5
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|