| Author |
Topic |
|
MikaSa
Starting Member
7 Posts |
Posted - 2012-03-22 : 18:17:01
|
| I have a column that with an expression that shows the to number of minutes a person waited from time of arrival to time waited on using datediff.I would like to take the average amount of wait time for returned results and display in the header.I am having trouble with the expression to average the returned results from a query.I would typically have five or more rows returned when the query is run.Any help would be appreciated?Thanks |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-03-22 : 19:46:20
|
| Is this in T-SQL or in SSRS? In either case, there is an Avg function that will calculate the average for you. |
 |
|
|
MikaSa
Starting Member
7 Posts |
Posted - 2012-03-22 : 19:57:53
|
| It's in ssrs. I am fairly new to srs and can't seem to grt the expression to work |
 |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-03-22 : 20:04:49
|
| I assume you have looked at this page and examples there: http://msdn.microsoft.com/en-us/library/ms159806(v=sql.100).aspx If that doesn't help you, can you post the expression that you want to get the average of? |
 |
|
|
MikaSa
Starting Member
7 Posts |
Posted - 2012-03-23 : 09:54:32
|
quote: Originally posted by sunitabeck I assume you have looked at this page and examples there: http://msdn.microsoft.com/en-us/library/ms159806(v=sql.100).aspx If that doesn't help you, can you post the expression that you want to get the average of?
I looked at the page but it wasn't what I was looking for. The expression I am trying to average isDateDiff("n",Fields!ARRIVAL_TIME.Value,Fields!VENIPUNTURE_TIME.Value) |
 |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-03-23 : 10:19:06
|
quote: Originally posted by MikaSaI looked at the page but it wasn't what I was looking for. The expression I am trying to average isDateDiff("n",Fields!ARRIVAL_TIME.Value,Fields!VENIPUNTURE_TIME.Value)
Doesn't this work?Avg(DateDiff("n",Fields!ARRIVAL_TIME.Value,Fields!VENIPUNTURE_TIME.Value))You may need to provide the dataset name as shown in the examples on the link that I posted earlier. |
 |
|
|
MikaSa
Starting Member
7 Posts |
Posted - 2012-03-23 : 13:06:57
|
| The problem seems to be that I trying to use this expression in the header |
 |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-03-23 : 21:06:13
|
| Not sure if being in the header will cause any problems, but first try it somewhere where it is in scope and see if that works. If it does, move it outside and include the dataset as the second parameter and see if that works. |
 |
|
|
MikaSa
Starting Member
7 Posts |
Posted - 2012-03-24 : 08:20:36
|
| What I ended up doing is creating a new row above and outside. put my expression in a cell and hid the row. I then placed a text in the headrer with the expression ReportItems!Textbox25.valueIt worked. |
 |
|
|
|