If you are grouping in a select statement every column that appears in the select list (other than aggregates) must be contained within the group by list. you are only grouping by date and time but are selecting a lot more than that
-----Original Message----- From: Danna D. Swain [mailto:[EMAIL PROTECTED] Sent: 20 March 2003 15:26 To: SQL Subject: SQL Error Message Any idea what is wrong with this.... SELECT dbo.NERR_Sites.NERR_Site_Name, dbo.Sampling_Stations.Station_Name, dbo.FormatWtemp(dbo.Water.Wtemp) As Wtemp, dbo.FormatSpCond(dbo.Water.SpCond) As SpCond, dbo.FormatSalinity(dbo.Water.Salinity) As Salinity, dbo.FormatDOsat(dbo.Water.DOsat) As DOsat, dbo.FormatDOconc(dbo.Water.DOconc) As DOconc, dbo.FormatDepth(dbo.Water.Depth) As Depth, dbo.FormatpH(dbo.Water.pH) As pH, dbo.FormatTurbid(dbo.Water.Turbid) As Turbid FROM dbo.NERR_Sites, dbo.Sampling_Stations, dbo.Water WHERE dbo.Water.NERR_Site_ID = 1 AND Water.NERR_Site_ID = NERR_Sites.NERR_Site_ID AND NERR_Sites.NERR_Site_ID = Sampling_Stations.NERR_Site_ID AND dbo.Water.Station_Code Like 'acebbwq' AND Water.Station_Code = Sampling_Stations.Station_Code And Wtemp = 2 And SpCond Like '%' And Salinity Like '%' And DOsat Like '%' And DOconc Like '%' Group By Date,Time This is the error that I get.... [MERANT][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC SQL Server Driver][SQL Server]Column 'dbo.NERR_Sites.NERR_Site_Name' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause. Danna D. Swain [EMAIL PROTECTED] NERR Centralized Data Management Office http://cdmo.baruch.sc.edu 843-546-6219 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=6 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=6 Get the mailserver that powers this list at http://www.coolfusion.com
