Can someone PLEASE help me with a query.. Its simple though tough... :( I have 4 columns and I need an avg based on date criteria or ID.. I have some Null values in between so when I am using AVG its showing Null for entire Column.. when I am using isnull its dragging down the average because its including 0 as well.. I tried Case when and it worked fine in SQL Server however I am creating this Query for Excel VBA ADO.. and there the query goes too long there.. the query that I had earlier (AVG one) worked fine.. I am looking out for any quick fix to exclude NULL values from table .. Thanks :) hope you understand!!Here is my query Select A_Date, EmpID, Emp_Name, AVG(([Flexibility_shown_towards_Teams_Target] + [Plans_avails_leave_as_per_team_quota] + [Compliance_to_Productive_Hours] + [Flexibility_to_change_in_Work]))/4 as People_Teamwork, AVG(([Follow_FIFO_methodology] + [Following_SOT_to_PnP] + [Confirm_the_completion_of_all_case]))/3 as Judgment_Decision_Making, AVG(([1_Bright_idea_Approved] + [1_Bright_Idea_implemented]))/2 as Change_innovation, AVG(([Compliance_with_Activity_Tracker] + [Compliance_to_Transport] + [PKT_Scores]))/3 as Demonstrate_Accountability_and_High_Performance, AVG(([Participation_membership_in_any_CSR_activity] + [Participation_membership_in_Company_group_or_activity]))/2 as Corporate_Social_Responsibilities, AVG(([Identifying_a_Mentee] + [Working_as_a_Team] + [Maintaining_consistency_in_self_perf_showing_impr_in_Mentees_res]))/3 as Mentor_MenteeFrom My_Datawhere A_date BETWEEN '04/01/11' AND '04/01/11' and EmpID = '000672516' group by A_Date, EmpID, Emp_Name
quote:
I am Only looking out for SQL Query can be excuted in EXCEL VBA