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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, Is there something wrong wit

Status
Not open for further replies.

sanjs

Technical User
Mar 2, 2003
28
GB
Hi,

Is there something wrong with this query?

SELECT TOP 10 appold.`Cost Code`, SUM((appold.`Data Units` + (appold.`Voice Units` + (appold.`Data Faults` + (appold.`Voice Faults` + (appold.Telephone + appold.Survey)))))) AS Sums FROM appold GROUP BY appold.`Cost Code` ORDER BY SUM((appold.`Data Units` + (appold.`Voice Units` + (appold.`Data Faults` + (appold.`Voice Faults` + (appold.Telephone + appold.Survey)))))) DESC

I get an error:

Error(-2147217900):[Microsoft][ODBC Microsft Access Driver] Syntax error (missing operator) in query expression...

Regards,

Sanjay
 
try it without the MySQL backticks


rudy
 
Thans Rudy,

But no joy it still reports that error.

Regards,

Sanjay
 
uh, sorry, i see you have some spaces in your column names

replace the backticks with square brackets:

select top 10
[Cost Code]
, sum( [Data Units]
+ [Voice Units]
+ [Data Faults]
+ [Voice Faults]
+ Telephone
+ Survey ) as Sums
from appold
group by [Cost Code]
order by sum( [Data Units]
+ [Voice Units]
+ [Data Faults]
+ [Voice Faults]
+ Telephone
+ Survey ) desc

 
Thanks r937,

But it still complains with the error - what the hell's wrong?

Sanjay
 
is this a pass-through query?

otherwise, i think the syntax is okay for access

you might want to ask on the access forum
 
Yes - I think, I use it in Dreamweaver and its fine, but I need it in another package that creates on-the-fly charts, which is where the error occurs. I contacted the product manufacturers and they say its an error in the sql - maybe they're wrong?

Regards,

Sanjay
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top