i have removed the [ddd]= part from the select, still it is showing error.
-----
Error Message: Msg 8120, Level 16, State 1, Procedure abc, Line 69
Column 'abc.ddd' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
------
also the case in group by clause, will it consider the '' after the "[ccc]," if the value is other than 1 ?
...
User Profile
Collapse
Profile Sidebar
Collapse
sam hank
Last Activity: Feb 22 '12, 07:36 PM
Joined: Feb 22 '12
Location:
-
Case statement and group by clause in function
Hi,
in this function, only using @c to decide whether to sum over the [ddd] column. i am doing it in this way but i am getting error.
Code:CREATE FUNCTION abc ( @Date_a datetime = '01/01/2010', @Date_b datetime = '01/01/2012, @c bit = 0 ) RETURNS @ret TABLE ( [aaa] [VARCHAR](100), [bbb] [DATETIME], [ccc] [DATETIME] [ddd] [VARCHAR](80),
No activity results to display
Show More
Leave a comment: