在ms访问中构建表达式 [英] building an expression in ms access

查看:46
本文介绍了在ms访问中构建表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在MS Access中为House Rent(HR)构建一个表达式。


如果基本工资(BS)=> 5000,HR是BS的50%但是不低于2250,

如果BS介于5001和10800之间,则为
,HR为BS的45%但不低于2500且


如果BS介于10801和21600之间,HR是BS的40%但不低于4800

I want to build an expression for House Rent (HR) in MS Access.

If Basic Salary (BS) is =>5000, HR is 50% of BS but not less than 2250,

if BS is between 5001 and 10800, HR is 45% of BS but not less than 2500 and

if BS is between 10801 and 21600, HR is 40% of BS but not less than 4800

推荐答案

这是出现在查询中还是出现在表单上的代码中?


看来你的标准出错了,我想你的意思是如果BS小于或者= 5000那么HR是50%


在表单上,​​您可以构建一系列if测试
Is this appearing in a query, or in code on a form?

It appears you made a mistake in your criteria, I think you mean if BS is less than or = 5000 then HR is 50%

On a form you could build a series of if tests
展开 | 选择 | 换行 | 行号


对不起,我的知识非常基础,我想在设计视图中为HR构建表达式,例如:


HR:

IIf([BS] <= 5000,[BS] * 0.5,但是如果[BS] * 0.5 <2250,2250,则

IIf([BS]> 5000和[ BS]< = 10800,[BS] * 0.45,但是如果[BS] * 0.45 <2500,2500,那么
IIf([BS]> 10800和[BS]< ; = 21600,[BS] * 0.4,但如果[BS] * 0.4 <4800,4800)))


这里,我不知道什么是正确的表达式''但如果''... pl帮助。谢谢。
Sorry, my knowledge is quite basic, I want to build expression for HR in design view something like:

HR:
IIf([BS]<=5000,[BS]*0.5,But if[BS]*0.5<2250,"2250",
IIf([BS]>5000 And [BS]<=10800,[BS]*0.45,But if[BS]*0.45<2500,"2500",
IIf([BS]>10800 And [BS]<=21600,[BS]*0.4,But if[BS]*0.4<4800,"4800")))

Here, I do not know what may be correct expression for ''But if''... pl help. thanks.


我假设计算是在查询上完成的。 (在查询设计视图中)


经过分析(通过)。我认为这样可以试试看:

copy& paste
I assume that calculation is done on a query. (In query Design View)

After a analysis (go through). I think this will work try it out:
copy&paste
展开 | 选择 | Wrap | 行号


这篇关于在ms访问中构建表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆