Running a simple query

L

Lucinda

Hi,

I am very new to Access ADP and SQL. In other words I am in over my head.
I am trying to write a query to sum Vacation Hours As Total Vacation Hours.
I am receiving Incorrect Syntax near the keyword 'AS'.

This worked in regular MDB Access so any help or advice would be greatly
appreciated.
 
B

Bob McClellan

You did not post your DML.
the sql should be the same though...
However, from what you've wrote...
try Sum([Vacation Hours]) as 'Total Vacation Hours'
hth,
bob
 
L

Lucinda

thank you. I found that if I removed the commas, it worked like a charm.
SELECT EMPLID, NAME, SUM([Vacation Hours Used 1] + [Vacation Hours Used
2] + [Vacation Hours Used 3] + [Vacation Hours Used 4] + [Vacation Hours Used
5] + [Vacation Hours Used 6] + [Vacation Hours Used 7] + [Vacation Hours Used
8] + [Vacation Hours Used 9] + [Vacation Hours Used 10]) AS Total
FROM LADOLFO.Combination
GROUP BY EMPLID, NAME

Bob McClellan said:
You did not post your DML.
the sql should be the same though...
However, from what you've wrote...
try Sum([Vacation Hours]) as 'Total Vacation Hours'
hth,
bob






Lucinda said:
Hi,

I am very new to Access ADP and SQL. In other words I am in over my head.
I am trying to write a query to sum Vacation Hours As Total Vacation
Hours.
I am receiving Incorrect Syntax near the keyword 'AS'.

This worked in regular MDB Access so any help or advice would be greatly
appreciated.
 

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