我有一个查询,可以获取员工获得、使用和离开的休假时间。我已经修改了“Gain”上的 Alike 语句来寻找“Anniversary”然后返回值。它现在返回 0 Iif 的失败语句。这是SQL。
SELECT
SchedulingLog.UserID,
SchedulingLog.Category,
Sum(IIf([CatDetail] ALike 'Anniversary*',[Value],0)) AS Gain,
Sum(IIf(CatDetail ALike '%Used',[Value],0)) AS Used, [Gain]+[Used] AS [Left]
FROM SchedulingLog
GROUP BY SchedulingLog.UserID, SchedulingLog.Category
HAVING (((SchedulingLog.Category) Like "Vac*"));