x
login about faq Site discussion (meta-askssc)

avg calculation in reports

the table data as follows
------------------------

id  answer  score
--- ------  ------ 
1     Y      100
2     N/A      0
3     N        0
4     Y      100

now in report group header i am calculating avg(amt) ...now i should not consider the answer N/A row at the time of doing avg...

more ▼

asked Sep 15 '11 at 11:57 PM in Default

Murali gravatar image

Murali
896 65 105 118

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

You can exclude unwanted record through where condition in query. e.g.

SELECT AVG(FIELD) FROM GROUP_HEADER WHERE answer <>'N/A'

more ▼

answered Sep 16 '11 at 12:11 AM

Amardeep gravatar image

Amardeep
1.3k 74 83 87

not in a query, we are doing at report level

Sep 16 '11 at 12:28 AM Murali
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x23

asked: Sep 15 '11 at 11:57 PM

Seen: 403 times

Last Updated: Sep 16 '11 at 12:50 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.