여러 쿼리를 사용했지만 그 중 하나는 각 직원의 급여 인상에 대해 말해줍니다. 그게 다야? 기한이 지난거야? 너무 일찍?조건이 작동하지 않는 경우 MS 액세스
쿼리에 매개 변수를 입력하라는 메시지가 계속 표시되고이 질문을 한 후 removing "enter parameter value" in query MS access 하나의 쿼리가 여러 개로 나뉘 었습니다. 각 쿼리는 if 조건이있는 마지막 쿼리까지 구성됩니다. 모든 것은 경우 조건을 제외하고, 정확하게 내가 그것을 원하는 방식으로 일했다 (전에 잘 작동하는 데 사용!)
을 이것은 내 임금 인상을위한 조건
Eligibility: 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")
규칙이 같은 경우 다음 : 직원의 평가가 3
- 경우, 그는 24 개월 만의 증가를 가져 그의 마지막
- 직원의 평가가 2이면, 그는 12-18하나를 얻을 수 17,451,515,개월
- 직원의 평가가 1 인 경우, 그가받는 일 9-15에 달 지금은 어떻게됩니까
, 직원의 일부, 나는 단지 하나 개의 레코드를 얻을 수 있다는 것입니다 그리고 그것은 맞습니다,하지만 일부에 대한 직원, 나는 2 개의 기록을 얻고, 그 중 하나는 정확하고 다른 하나는 그렇지 않다. 이제 대신 48 개 기록 (I는 조건이 좋은 일을 할 때 얻을 무엇을 사용), 나는이
당신의 도움이 많이 감사합니다SELECT 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 Eligibility
,MonthsSinceLastUpdateQ.LocalID
,MonthsSinceLastUpdateQ.LastOfRatings
,MonthsSinceLastUpdateQ.MaxOfDateOfUpdate
,MonthsSinceLastUpdateQ.MonthsSinceLastIncrease
FROM MonthsSinceLastUpdateQ
,DateOfUpdateQ
GROUP BY 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")
,MonthsSinceLastUpdateQ.LocalID
,MonthsSinceLastUpdateQ.LastOfRatings
,MonthsSinceLastUpdateQ.MaxOfDateOfUpdate
,MonthsSinceLastUpdateQ.MonthsSinceLastIncrease;
,주의하시기 바랍니다 전체 쿼리의 코드는 58
수 나는 간신히 코딩을 알고 있으며 MS Access에 대해서만 배우기 시작했습니다. 감사합니다!
DateOfUpdateQ를 반환하는 행 수는 얼마나됩니까? 두 쿼리가 서로 연결되어 있지 않으면 레코드가 중복 될 수 있습니다. DateOfUpdateQ –
DateOfUpdateQ는 48을 반환합니다. 쿼리를 어떻게 연결합니까? –
'JOIN'을 사용하거나 쿼리 작성기에서 조인해야하는 열을 끌어다 놓습니다. –