Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 3 个值 saleprice、productprice 和 reward_price。我需要让它先查找销售价格,如果没有销售价格,则查看产品价格。然后抓住它并将其向上或向下舍入 50 美分。苏..
SELECT Format(IIf(saleprice Is Null, productprice, saleprice), '#') AS reward_price FROM YourTable;
Format()返回一个字符串。如果您需要将reward_price作为实际数字,您可以将字段表达式包装在转换函数中,例如Val(), CCur(),CInt()等。
Format()
Val()
CCur()
CInt()