所以我和初学者一样多。我几乎不知道如何编码,而且我在学习Access时也是如此。
我有两个表:EmployeesT(有员工基本信息)和IncreaseT(每次每个员工的薪水都有记录)
我目前遇到了一个应该执行以下操作的查询:
我的问题是,当我尝试打开查询时,它会要求我输入参数值"为:
最后评分(评分字段包含上次总计),
Max of DateOfLastUpdate(具有最大总数的DateOfLastUpdate字段)和
MonthsSinceLastUpdate(DateDiff(" m",[MaxOfDateOfUpdate],Now())
这是查询的代码:
SELECT EmployeesT.LocalID, Last(IncreaseT.Ratings) AS LastOfRatings, Max(IncreaseT.DateOfUpdate) AS MaxOfDateOfUpdate, DateDiff("m",[MaxOfDateOfUpdate],Now()) AS MonthsSinceLastIncrease, IIf([MonthsSinceLastIncrease]<24,IIf([MonthsSinceLastIncrease]>=18 And [LastOfRatings]<=2,"Overdue",IIf([MonthsSinceLastIncrease]>=15 And [LastOfRatings]=1,"Overdue",IIf([MonthsSinceLastIncrease]>=9 And [MonthsSinceLastIncrease]<15 And [LastOfRatings]=1,"Eligible",IIf([MonthsSinceLastIncrease]>=12 And [MonthsSinceLastIncrease]<18 And [LastOfRatings]=2,"Eligible","ok")))),"Overdue") AS Eligiblity
FROM EmployeesT INNER JOIN IncreaseT ON EmployeesT.LocalID = IncreaseT.Employee
WHERE (((IncreaseT.Increase)>0))
GROUP BY EmployeesT.LocalID, DateDiff("m",[MaxOfDateOfUpdate],Now()), IIf([MonthsSinceLastIncrease]<24,IIf([MonthsSinceLastIncrease]>=18 And [LastOfRatings]<=2,"Overdue",IIf([MonthsSinceLastIncrease]>=15 And [LastOfRatings]=1,"Overdue",IIf([MonthsSinceLastIncrease]>=9 And [MonthsSinceLastIncrease]<15 And [LastOfRatings]=1,"Eligible",IIf([MonthsSinceLastIncrease]>=12 And [MonthsSinceLastIncrease]<18 And [LastOfRatings]=2,"Eligible","ok")))),"Overdue");
任何帮助都会非常感激,我试着阅读其他帖子并将相同的逻辑应用到我的但没有运气,我在设计视图中做了我的全部事情,代码中的一切对我来说太混乱了