我很多orders in my Factory
。
我们完成工作的正常时间是10天,但有时我们向客户保证会缩短工作时间(假设5天)。
我试图通过以下命令建立一个SQL顺序minimum Date of the two columns
:
SELECT id, Status, DeliveryDate, PromiseDate
FROM CustomerOrderT
WHERE Status > 2 and Status <7
ORDER BY CASE WHEN DeliveryDate > PromiseDate then PomiseDate ELSE DeliveryDate END;
但我从ms访问中收到问题消息。也许写正确的问题附加按摩
谢谢
在MS Access中,您必须使用IIF代替Case,例如:
SELECT id, Status, DeliveryDate, PromiseDate
FROM CustomerOrderT
WHERE Status > 2 and Status <7
ORDER BY IIF(DeliveryDate > PromiseDate, PromiseDate, DeliveryDate);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句