View and Grouping


I have created a view in SQL that contains a rather complex query.
The query contains a cople of tables, joins etc and grouping

The problem is that it's just one field called ExecutionDate that i don't want for grouping or result
the only thing i want to do is a selection on it.

The problem is when i use the view from a query or from qrystal reports, i can not do a selection on that field since it is not in the views select statement.

How ever inside the view, createing a where clause is no problem

Any ideas?
Who is Participating?
Patrick MatthewsConnect With a Mentor Commented:
Hello MrHswede,

If you want that column included in the view, then you must include it in the SELECT clause for the view.

Further, since your view has a GROUP BY clause, that column must either be in the GROUP BY clause as
well, or used in an aggregate expression in the SELECT clause.


Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.