Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dummy field and GROUP BY 1

Status
Not open for further replies.

JerryKlmns

IS-IT--Management
Feb 7, 2005
2,062
GR

I 'm trying to execute this sql statement

SELECT 'CIASF' As TableName,
ASF_DATE As DateIn,
Count(*) As Counted
FROM dbo.CIASF
GROUP BY 'CIASF',
ASF_DATE
ORDER BY 2;

using an SQL Pass-Through query from MS-Access. Although for an MSAccess table that would be succesful, I get:
Each GROUP BY expression must contain at least one column reference (#329)
for SQL Server 2005
CIASF is not a field just a column I need to be shown with that value
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top