I need a sample code/syntax to create a sql expression field to calculate sum and count using Sql Server 2005.
I have tried multiple option without any luck. Any help in this regard will be appreciated.
I have found that, in general, putting a full select statement in a SQL expression doesn't work. SQL expressions are added to the select list of the SQL that Crystal sends to the database. So, if your database doesn't support structures like:
Select
Field1,
Field2,
(Select Count(*)
from TableB) as countit
from TableA
Then the SQL Expression won't work.
-Dell
A computer only does what you actually told it to do - not what you thought you told it to do.
SQL expressions are intended to return only one value per the criteria, not a set of values. If a set of values per row is what you need, then "Add command" is the way to go.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.