I have a nested query and it comes up with an error saying "Run-Time error 3131, Syntax error in FROM Clause"
and i keep looking at my code and I just dont know whats wrong.
So any help would be much appreciated.
strSql = "SELECT Count(Counter) AS CountOfCounter, [Type of Complaint], Format([Date],""mm/yyyy""
AS Month" & _
" FROM (SELECT [Complaints Table].Counter, [Complaints Table].[Type of Complaint], [Complaints Table].Date, [Complaints Table].[Attributable to Company]" & _
" FROM [Complaints Table]" & _
" WHERE ((([Complaints Table].Date) Between #" & _
Forms![Print Request between dates]!sdate & "# And # " & _
Forms![Print Request between dates]!edate & "#)) " & _
" AND (([Complaints Table].[Attributable to Company])=""epco""
" & _
" ORDER BY [Complaints Table].[Type of Complaint], [Complaints Table].Date
" & _
" GROUP BY [Type of Complaint], Format([Date],""mm/yyyy""
);"
and i keep looking at my code and I just dont know whats wrong.
So any help would be much appreciated.
strSql = "SELECT Count(Counter) AS CountOfCounter, [Type of Complaint], Format([Date],""mm/yyyy""
" FROM (SELECT [Complaints Table].Counter, [Complaints Table].[Type of Complaint], [Complaints Table].Date, [Complaints Table].[Attributable to Company]" & _
" FROM [Complaints Table]" & _
" WHERE ((([Complaints Table].Date) Between #" & _
Forms![Print Request between dates]!sdate & "# And # " & _
Forms![Print Request between dates]!edate & "#)) " & _
" AND (([Complaints Table].[Attributable to Company])=""epco""
" ORDER BY [Complaints Table].[Type of Complaint], [Complaints Table].Date
" GROUP BY [Type of Complaint], Format([Date],""mm/yyyy""