Share via

Arithmetic Overflow Error

Anonymous
2010-05-19T16:15:58+00:00

I have written a query to calculate if a person has used vacation within a certain pay period, this is identified with an ID.  It worked beautifully -- now I am getting the arithmetic overflow error and have no idea why.  Here is the query.  This is Access 2007 ADP with SQL 2000

SELECT DISTINCT

                        dbo.March_Vac_Start.EMPLID, dbo.March_Vac_Start.NAME,

                        CASE WHEN LADOLFO.PAY_PERIOD_STARTING.ID = '7' THEN SUM(dbo.March_Vac_Start.CURRENT_VAC_BALANCE - COALESCE (dbo.Vacation_Used.Vacation_Used,

                         0)) ELSE dbo.March_Vac_Start.CURRENT_VAC_BALANCE END AS Vacation_Used_Apr15

FROM          dbo.March_Vac_Start LEFT OUTER JOIN

                        LADOLFO.VACATIONHOURS1 INNER JOIN

                        LADOLFO.PAY_PERIOD_STARTING ON

                        LADOLFO.VACATIONHOURS1.PAY_PERIOD_STARTING = LADOLFO.PAY_PERIOD_STARTING.PAY_PERIOD_STARTING ON

                        dbo.March_Vac_Start.EMPLID = LADOLFO.VACATIONHOURS1.EMPLID LEFT OUTER JOIN

                        dbo.Vacation_Used ON dbo.March_Vac_Start.EMPLID = dbo.Vacation_Used.EMPLID

GROUP BY LADOLFO.PAY_PERIOD_STARTING.ID, dbo.March_Vac_Start.EMPLID, dbo.March_Vac_Start.NAME, dbo.March_Vac_Start.CURRENT_VAC_BALANCE

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2010-05-19T18:01:54+00:00

HA!!!  You see with enough diet coke pumped in you -- you can figure it out.  I needed to link the ID to the Pay Period.  It works like a charm now.

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful