TFCJamieFay
Active Member
- Joined
- Oct 3, 2007
- Messages
- 480
Hi all,
Can anyone see why this query is hitting a syntax error (missing operator)? I've added as many square brackets as possible, but still there's a problem!
It seems to point at my joins, I know DISTINCT queries are a nightmare in Access, but it all looks OK to me. Any help would be great.
Cheers,
Jay
Can anyone see why this query is hitting a syntax error (missing operator)? I've added as many square brackets as possible, but still there's a problem!
It seems to point at my joins, I know DISTINCT queries are a nightmare in Access, but it all looks OK to me. Any help would be great.
Cheers,
Jay
Code:
SELECT
[Activity].[Activity_Time] AS Session_Start_Time ,
COUNT ( [qryVisitor].[Visitor_ID] ) AS Unique_Visitors ,
COUNT ( [qrySession].[Session_Key] ) AS Sessions
FROM [Activity]
LEFT JOIN Lookup
ON [Activity].[Session_Key] = [Lookup].[Session_Key]
INNER JOIN ( SELECT DISTINCT [Session_Key], [Visitor_ID] FROM [Lookup] ) qryVisitor
ON [Activity].[Session_Key] = [qryVisitor].[Session_Key]
INNER JOIN ( SELECT DISTINCT [Session_Key] FROM [Activity] ) qrySession
ON [Activity].[Session_Key] = [qrySession].[Session_Key]
GROUP BY 1
ORDER BY 1 ASC
;