L
Lucinda
Hello again,
I'm still finding may way here with Access ADP and SQL queries. I was going
along at a clip writing simple queries. My First one was to total Vacation
Balance in 2009:
SELECT LADOLFO.Combination.EMPLID, LADOLFO.Combination.NAME,
LADOLFO.[2009 Vacation Balance].[Vacation Balance]
FROM LADOLFO.[2009 Vacation Balance] CROSS JOIN
LADOLFO.Combination
Worked just fine. My Second was Total all Vacation Earned:
SELECT EMPLID, NAME, SUM([Vacation Earned]) AS Total
FROM LADOLFO.Combination
GROUP BY EMPLID, NAME
Worked great. And My last one Vacation Used:
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
My problem is that I want to combine these three Queries or Views into one.
I want it to kick back:
2009 Vacation Balance + Vacation Earned-Vacation used. This is my attempt
at it:
SELECT dbo.[2009_VAC].[Vacation Balance], dbo.VAC_EARNED.Total,
dbo.[Vacation used].Total AS EXPR1, Sum(dbo.[2009_VAC].[Vacation
Balance]+dbo.VAC_EARNED.Total-dbo.[Vacation used].Total AS EXPR1)AS Vac_Total
FROM dbo.VAC_EARNED INNER JOIN
dbo.[2009_VAC] ON dbo.VAC_EARNED.EMPLID =
dbo.[2009_VAC].EMPLID INNER JOIN
dbo.[Vacation used] ON dbo.VAC_EARNED.EMPLID =
dbo.[Vacation used].EMPLID
when I click on the SQL Check-- it does not work:
I receive an ADO Error: 'SUM' is not a recognized function name. Statement
could not be prepared.
Any help would be appreciated.
I'm still finding may way here with Access ADP and SQL queries. I was going
along at a clip writing simple queries. My First one was to total Vacation
Balance in 2009:
SELECT LADOLFO.Combination.EMPLID, LADOLFO.Combination.NAME,
LADOLFO.[2009 Vacation Balance].[Vacation Balance]
FROM LADOLFO.[2009 Vacation Balance] CROSS JOIN
LADOLFO.Combination
Worked just fine. My Second was Total all Vacation Earned:
SELECT EMPLID, NAME, SUM([Vacation Earned]) AS Total
FROM LADOLFO.Combination
GROUP BY EMPLID, NAME
Worked great. And My last one Vacation Used:
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
My problem is that I want to combine these three Queries or Views into one.
I want it to kick back:
2009 Vacation Balance + Vacation Earned-Vacation used. This is my attempt
at it:
SELECT dbo.[2009_VAC].[Vacation Balance], dbo.VAC_EARNED.Total,
dbo.[Vacation used].Total AS EXPR1, Sum(dbo.[2009_VAC].[Vacation
Balance]+dbo.VAC_EARNED.Total-dbo.[Vacation used].Total AS EXPR1)AS Vac_Total
FROM dbo.VAC_EARNED INNER JOIN
dbo.[2009_VAC] ON dbo.VAC_EARNED.EMPLID =
dbo.[2009_VAC].EMPLID INNER JOIN
dbo.[Vacation used] ON dbo.VAC_EARNED.EMPLID =
dbo.[Vacation used].EMPLID
when I click on the SQL Check-- it does not work:
I receive an ADO Error: 'SUM' is not a recognized function name. Statement
could not be prepared.
Any help would be appreciated.