AFAIK if you use group by then you must group by all the columns listed rather than just a few, so in your statement youll need to include
dbo.NERR_Sites.NERR_Site_Name, dbo.Sampling_Stations.Station_Name, Wtemp, SpCond, Salinity, DOsat, DOconc, Depth pH, Turbid HTH -----Original Message----- From: Danna D. Swain [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 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
