Thanks for your reply Ken. The query as it works is:
SELECT RWPlusOverheadAndContract.[Cost Centre],
BusinessCaseCCOhead.Overhead
AS OverheadPercent, Contract.Description, RWPlusOverheadAndContract.Date,
-[Amount] AS PosAmount, -Round([Amount]*[OverheadPercent],2) AS
OverheadAmount, RWPlusOverheadAndContract.Document,
RWPlusOverheadAndContract.Account, BusinessCaseCCOhead.ContactPersonName
AS
ContactPersonName, RWPlusOverheadAndContract.ContractID AS BusinessCaseID,
BusinessCaseCCOhead.ContactPersonName AS CName,
Forms!OverheadCalcChooseDates!txtStartDate AS StartDate,
Forms!OverheadCalcChooseDates!txtFinishDate AS FinishDate
FROM BusinessCaseCCOhead INNER JOIN (RWPlusOverheadAndContract INNER JOIN
Contract ON RWPlusOverheadAndContract.ContractID = Contract.ID) ON
(BusinessCaseCCOhead.BusinessCase = RWPlusOverheadAndContract.ContractID)
AND
(BusinessCaseCCOhead.CostCentre = RWPlusOverheadAndContract.[Cost Centre])
WHERE
(((RWPlusOverheadAndContract.Date)<=[Forms]![OverheadCalcChooseDates]![txtFinishDate]
And
(RWPlusOverheadAndContract.Date)>=[Forms]![OverheadCalcChooseDates]![txtStartDate]));
When I change it to:
SELECT RWPlusOverheadAndContract.[Cost Centre],
BusinessCaseCCOhead.Overhead
AS OverheadPercent, Contract.Description, RWPlusOverheadAndContract.Date,
-[Amount] AS PosAmount, -Round([Amount]*[OverheadPercent],2) AS
OverheadAmount, RWPlusOverheadAndContract.Document,
RWPlusOverheadAndContract.Account, BusinessCaseCCOhead.ContactPersonName
AS
ContactPersonName, RWPlusOverheadAndContract.ContractID AS BusinessCaseID,
BusinessCaseCCOhead.ContactPersonName AS CName,
Forms!OverheadCalcChooseDates!txtStartDate AS StartDate,
Forms!OverheadCalcChooseDates!txtFinishDate AS FinishDate,
[Forms]![OverheadCalcChooseDates]![cmbCostCentre] AS Expr1
FROM BusinessCaseCCOhead INNER JOIN (RWPlusOverheadAndContract INNER JOIN
Contract ON RWPlusOverheadAndContract.ContractID = Contract.ID) ON
(BusinessCaseCCOhead.BusinessCase = RWPlusOverheadAndContract.ContractID)
AND
(BusinessCaseCCOhead.CostCentre = RWPlusOverheadAndContract.[Cost Centre])
WHERE
(((RWPlusOverheadAndContract.Date)<=[Forms]![OverheadCalcChooseDates]![txtFinishDate]
And
(RWPlusOverheadAndContract.Date)>=[Forms]![OverheadCalcChooseDates]![txtStartDate])
AND (([Forms]![OverheadCalcChooseDates]![cmbCostCentre]) Is Null Or
([Forms]![OverheadCalcChooseDates]![cmbCostCentre])=[RWPlusOverheadAndContract].[Cost
Centre]));
it doesn't work in 2003 but does in 2007! Aaargh! My client has 2003, so I
would really like to stick with that, but could probably get them to
upgrade
if that's the only answer.
Look forward to your reply,
Michael
--
Revelation 20:11-15
Ken Snell (MVP) said:
Post the SQL statement of the query. I'm guessing that you're using a
Totals
query, and grouping on the date field; sometimes that can cause this
"weird"
result.
--
Ken Snell
<MS ACCESS MVP>
"Michael Manukau Inst of Technology NZ"