Hi all,

I'm having a problem with a query that has run smoothly until today. It's a query that I run 5 times with the difference being the area criteria. This has worked for 4 out of 5 of the queries but for some reason the last one does not want to work with an updated source for yearly rates (all the others do okay) If I change the area in this query to that of another area then it will run fine - for some reason there is a "data type mismatch in criteria expression" being thrown up, even though all queries use all teh same data sources. I can't figure out what's happening, it;s only happening where teh area is "North"

SQL is:

SELECT Time.[Charge Type], Time.Invoice_Date, Time.Invoice_Ref, Time.Client_Ref, Time.Area, Sum(Time.Hours) AS SumOfHours, Sum(Time.Charge) AS SumOfCharge, Sum(Time.Profit) AS SumOfProfit, Sum(Time.OH) AS SumOfOH, Sum(Time.Total) AS SumOfTotal, Time.Comments, Time.MWH_Ref, Time.MWH_E1_Code, Time.UU_Standardised_Order_No, Time.UU_Standardised_Project_Name, IIf([AMP_4_Calendar_Year]="Yr 1",Sum([Agreed_Yr_1_Rate]*[Hours]),0) AS [Yr_1_ Extension], IIf([AMP_4_Calendar_Year]="Yr 2",Sum([Agreed_Yr_2_Rate]*[Hours]),0) AS Yr_2_Extension, IIf([AMP_4_Calendar_Year]="Yr 3",Sum([Agreed_Yr_3_Rate]*[Hours]),0) AS Yr_3_Extension, IIf([AMP_4_Calendar_Year]="Yr 4",Sum([Agreed_Yr_4_Rate]*[Hours]),0) AS Yr_4_Extension, IIf([AMP_4_Calendar_Year]="Yr 5",Sum([Agreed_Yr_4_Rate]*[Hours]),0) AS Yr_5_Extension, Time.Staff_No
FROM [Time]
GROUP BY Time.[Charge Type], Time.Invoice_Date, Time.Invoice_Ref, Time.Client_Ref, Time.Area, Time.Comments, Time.MWH_Ref, Time.MWH_E1_Code, Time.UU_Standardised_Order_No, Time.UU_Standardised_Project_Name, Time.Staff_No, Time.TS_Week, Time.Staff_Name, Time.Approved, Time.Agreed_Yr_1_Rate, Time.Agreed_Yr_2_Rate, Time.Agreed_Yr_3_Rate, Time.Agreed_Yr_4_Rate, Time.Agreed_Yr_5_Rate, Time.AMP_4_Calendar_Year
HAVING (((Time.Area)="North") AND ((Time.Approved)="Y"));

Any help appreciated.

Thanks

Richard