Groups | Blog | Home
all groups > sql server (alternate) > august 2004 >

sql server (alternate) : SQL select statement error


sadeeq NO[at]SPAM comcast.net
8/5/2004 1:17:44 PM
Please help me debug this statement:

Select vVehRegNAddr.RegContChar1 From (((vVeh LEFT OUTER JOIN
vVehBrand ON vVeh.Plate = vVehBrand.Plate) LEFT OUTER JOIN
vVehRegNAddr ON vVeh.Plate = vVehRegNAddr.Plate) LEFT OUTER JOIN
vVehLegal ON vVeh.Plate = vVehLegal.Plate) Where ((vVeh.Active = 1)
AND (vVeh.VUse NOT IN ('C/G','H/D','SNO','SNX')) AND (vVeh.LExpDt =
'20050715'))

ERROR MESSAGE:
"
Error in selection of Aggregates:
If ANY aggregate functions(Count, Sum,...) are chosen,All fields must
be aggregate that are not in Grouping
Erland Sommarskog
8/5/2004 9:30:51 PM
Sadeeq (sadeeq@comcast.net) writes:
[quoted text, click to view]

When I run your query in Query Analyzer, I get errors anout missing
objects, which means that we got past the syntax check.

The error message you post, does not seem familiar to me. Are you
really using MS SQL Server, or in which environment do you get this
message.



--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
Sadeeq Simmons
8/6/2004 3:24:39 AM
The application is proprietary, but runs on SQL.
It turned out that it worked after a few tries. i'm guessing that the
server connection was initially unstable.

Thanks for taking the time to check it out!

*** Sent via Developersdex http://www.developersdex.com ***
AddThis Social Bookmark Button