SELECT Attendance.EventID, Events.[Event Name], Sum(Attendance.Attend) AS SumOfAttend, IIf([SumOfAttend]>30,"Over","Under") AS OverUnder30
当我在Access 2013 Access中运行此SQL语句时会弹出一个参数框,并希望我获得SumOfAttend的值。我想测试已计算的SumOfAttend值,如果超过30,则显示在另一个字段中,如果小于30,我希望它显示在
下谢谢
答案 0 :(得分:1)
假设您故意删除了此处的FROM子句...您可以使用以下SELECT子句来执行您想要的操作:
SELECT Attendance.EventID, Events.[Event Name], Sum(Attendance.Attend) AS SumOfAttend, IIf(Sum(Attendance.Attend)>30,"Over","Under") AS OverUnder30
这样您就不会依赖Access来了解[SumOfAttend]