K
KD
Could someone be so kind to tell me if there is a more elegant way of
determining the "effective date" compared to my beginners attempt
below:
SELECT *
FROM tbl_Rates
WHERE (tbl_Rates.EffectiveDate =
(SELECT MAX(Temp.EffectiveDate)
FROM tbl_Rates AS Temp
WHERE (Temp.EffectiveDate <= #08/08/2010#
AND Temp.Payroll_Company = "XXXX PTY LTD"
AND Temp.Payroll_Location = "Cleaning"
AND Temp.OnCost_type = "PayrollTax"))
AND tbl_Rates.Payroll_Company = "XXXX PTY LTD"
AND tbl_Rates.Payroll_Location = "Cleaning"
AND tbl_Rates.OnCost_type = "PayrollTax");
determining the "effective date" compared to my beginners attempt
below:
SELECT *
FROM tbl_Rates
WHERE (tbl_Rates.EffectiveDate =
(SELECT MAX(Temp.EffectiveDate)
FROM tbl_Rates AS Temp
WHERE (Temp.EffectiveDate <= #08/08/2010#
AND Temp.Payroll_Company = "XXXX PTY LTD"
AND Temp.Payroll_Location = "Cleaning"
AND Temp.OnCost_type = "PayrollTax"))
AND tbl_Rates.Payroll_Company = "XXXX PTY LTD"
AND tbl_Rates.Payroll_Location = "Cleaning"
AND tbl_Rates.OnCost_type = "PayrollTax");