G
Guest
Hi, I wonder if someone could help. I'm trying to run the following query on
an Access database..
SELECT Stories.StoryTitle, COUNT(Comments.CommentID) AS ComCount
FROM (Stories INNER JOIN
Comments ON Stories.StoryID = Comments.StoryID)
WHERE (Stories.StoryID = ?)
The Stories table contains multiple rows, and the comments table may or may
not contain rows which relate to the story (stories.storyid =
comments.storyid).
I'm trying to obtain 1 story row which includes a count of the number of
related Comments records, like...
StoryTitle | ComCount
-------------------------------------------
The Jungle Book | 3
But everytime I run the query I get the following error...
SQL Execution Error.
Error Source: Microsoft JET Database Engine
Error Message: You tried to execute a query that does not include the
specified expression 'StoryTitle' as part of an aggregate function.
What does this error mean, and how can I fix my SQL Statement to make it work?
Thanks
Dan
an Access database..
SELECT Stories.StoryTitle, COUNT(Comments.CommentID) AS ComCount
FROM (Stories INNER JOIN
Comments ON Stories.StoryID = Comments.StoryID)
WHERE (Stories.StoryID = ?)
The Stories table contains multiple rows, and the comments table may or may
not contain rows which relate to the story (stories.storyid =
comments.storyid).
I'm trying to obtain 1 story row which includes a count of the number of
related Comments records, like...
StoryTitle | ComCount
-------------------------------------------
The Jungle Book | 3
But everytime I run the query I get the following error...
SQL Execution Error.
Error Source: Microsoft JET Database Engine
Error Message: You tried to execute a query that does not include the
specified expression 'StoryTitle' as part of an aggregate function.
What does this error mean, and how can I fix my SQL Statement to make it work?
Thanks
Dan