Hi,
I have two queries:
VAC_TIME_BY_YEAR (calculates earned vacation pay)
and
VAC_TIME_PAID_BY_YEAR (calculates already paid vacation pay)
I tried to combine output from both so it would show earned vacation pay, already paid vacation pay (zero if nothing paid yet), vacation pay to be paid (difference between those two), like in this Excel
All my attempts failed saying 'fields from record sources can't connect' even I created and saved relationship between those two (EMP_ID).
Is there any way to do as query (or report) instead copy and do it manually in Excel?
Thanks
I have two queries:
VAC_TIME_BY_YEAR (calculates earned vacation pay)
SQL:
SELECT dbo_TIME_T.TIME_F_EMP_NUM AS EMP_ID, dbo_TIME_T.TIME_F_DIV_NUM AS DIVISION, dbo_EE_T.EE_F_SUR AS LAST_NAME, dbo_EE_T.EE_F_FIRST AS FIRST_NAME, Sum(dbo_TIME_T.TIME_F_AMOUNT) AS EARNED, Sum([dbo_TIME_T].[TIME_F_AMOUNT])*0.04 AS VACPAY
FROM dbo_TIME_T, dbo_EE_T
WHERE (((Left([TIME_F_PAY_PERIOD],4))=[ENTER YEAR:]) AND ((dbo_TIME_T.TIME_F_DIV_NUM)=2) AND ((dbo_TIME_T.TIME_F_PAY_CODE)<499 And (dbo_TIME_T.TIME_F_PAY_CODE)<>303) AND ((dbo_TIME_T.TIME_F_EMP_NUM)=[dbo_EE_T].[EE_FP_EMP_NUM]))
GROUP BY dbo_TIME_T.TIME_F_EMP_NUM, dbo_TIME_T.TIME_F_DIV_NUM, dbo_EE_T.EE_F_SUR, dbo_EE_T.EE_F_FIRST
ORDER BY dbo_EE_T.EE_F_SUR;
and
VAC_TIME_PAID_BY_YEAR (calculates already paid vacation pay)
SQL:
SELECT [dbo_TIME_T].[TIME_F_EMP_NUM] AS EMP_ID, [dbo_TIME_T].[TIME_F_DIV_NUM] AS DIVISION, [dbo_EE_T].[EE_F_SUR] AS LAST_NAME, [dbo_EE_T].[EE_F_FIRST] AS FIRST_NAME, Sum([dbo_TIME_T].[TIME_F_AMOUNT]) AS VAC_PAID
FROM dbo_TIME_T, dbo_EE_T
WHERE (((Left([TIME_F_PAY_PERIOD],4))=[ENTER YEAR:]) And (([dbo_TIME_T].[TIME_F_DIV_NUM])=2) And (([dbo_TIME_T].[TIME_F_PAY_CODE])=303) And (([dbo_TIME_T].[TIME_F_EMP_NUM])=[dbo_EE_T].[EE_FP_EMP_NUM]))
GROUP BY [dbo_TIME_T].[TIME_F_EMP_NUM], [dbo_TIME_T].[TIME_F_DIV_NUM], [dbo_EE_T].[EE_F_SUR], [dbo_EE_T].[EE_F_FIRST]
ORDER BY dbo_EE_T.EE_F_SUR;
I tried to combine output from both so it would show earned vacation pay, already paid vacation pay (zero if nothing paid yet), vacation pay to be paid (difference between those two), like in this Excel
All my attempts failed saying 'fields from record sources can't connect' even I created and saved relationship between those two (EMP_ID).
Is there any way to do as query (or report) instead copy and do it manually in Excel?
Thanks