This query runs on my pc but not on my laptop

G

GWB

SELECT sum(AvgOfCurrentSteamFlow)

FROM [SELECT dbo_Boiler_Steam_Production.ReadingDate AS Expr1,
Hour([ReadingTime]) AS Expr3,
Avg(dbo_Boiler_Steam_Production.CurrentSteamFlow) AS AvgOfCurrentSteamFlow

FROM dbo_Boiler_Steam_Production

GROUP BY dbo_Boiler_Steam_Production.ReadingDate, Hour([ReadingTime])

HAVING (((Year([ReadingDate]))=[Select Year]))]. AS [%$##@_Alias];


Failure message is: invalid bracketing of name 'SELECT........
 
K

KenSheridan via AccessMonster.com

Have you tried reverting to the original SQL which you presumably entered
when first creating the query, and letting Access rebuild it with the square
brackets? At the same time you should be able to simplify it and give the
subquery a more intelligible alias, e.g.

SELECT SUM(AvgOfCurrentSteamFlow) AS TotalAverageFlow
FROM (SELECT AVG(CurrentSteamFlow) AS AvgOfCurrentSteamFlow
FROM dbo_Boiler_Steam_Production
WHERE YEAR(ReadingDate = [Select Year]
GROUP BY ReadingDate, HOUR(ReadingTime) AS AverageFlows;

Ken Sheridan
Stafford, England
SELECT sum(AvgOfCurrentSteamFlow)

FROM [SELECT dbo_Boiler_Steam_Production.ReadingDate AS Expr1,
Hour([ReadingTime]) AS Expr3,
Avg(dbo_Boiler_Steam_Production.CurrentSteamFlow) AS AvgOfCurrentSteamFlow

FROM dbo_Boiler_Steam_Production

GROUP BY dbo_Boiler_Steam_Production.ReadingDate, Hour([ReadingTime])

HAVING (((Year([ReadingDate]))=[Select Year]))]. AS [%$##@_Alias];

Failure message is: invalid bracketing of name 'SELECT........
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top