[thelist] Understanding an SQL Problem

Joe Lance JoeL at HUMBOLDTBANK.COM
Tue Jan 7 15:14:01 CST 2003


You need to add DateAccessed to your group by clause
and it should work fine

SELECT DateAccessed, TimeAccessed
FROM IntranetLog
where DateAccessed = '1/6/03'
Group By TimeAccessed, DateAccessed
Order by TimeAccessed

Joe

-----Original Message-----
From: Rob Smith [mailto:rob.smith at THERMON.com]
Sent: Tuesday, January 07, 2003 1:08 PM
To: Thelist (E-mail)
Subject: [thelist] Understanding an SQL Problem


Hi list,

Here's my SQL Query:
SELECT DateAccessed, TimeAccessed FROM IntranetLog where DateAccessed =
'1/6/03' Group By TimeAccessed Order by TimeAccessed

Here's the error I'm getting:
Column 'IntranetLog.DateAccessed' is invalid in the select list because it
is not contained in either an aggregate function or the GROUP BY clause.

I have no idea how to resolve this because the error message is not helpful
as usual.

Thanks for your help,

Rob Smith
--
* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !



More information about the thelist mailing list