为什么这不适用于我的报告?! [英] Why won't this work in my report?!

查看:89
本文介绍了为什么这不适用于我的报告?!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为rptCarSheet的报告,该报告在名为ShiftID的字段上分组。在ShiftID组中,我有几个字段,我试图通过以下表达式输入数据:


[exp] = IIf([AreaID] =" 1",[Employee] )[exp]

每个字段的
我已经将AreaID值更改为我需要的值" 2" " 3英寸


我的问题是它只适用于输入的第一个实例。我也在细节部分尝试了它并得到同样的问题。


请告诉我我做错了什么

谢谢

Dan

I have a report called rptCarSheet that is grouped on a field called ShiftID. In the ShiftID Group I have several fields that I am trying to input data by the following expression:

[exp] =IIf([AreaID]="1",[Employee]) [exp]

for each field I have changed the AreaID value the the value I need "2" "3" etc.

My problem is that it only works for the first instance entered. I have tried it in the details section as well and get the same issue.

Please tell me what I am doing wrong
Thanks
Dan

推荐答案


我有一个名为rptCarSheet的报告,该报告在名为ShiftID的字段上分组。在ShiftID组中,我有几个字段,我试图通过以下表达式输入数据:


[exp] = IIf([AreaID] =" 1",[Employee] )[exp]

每个字段的
我已经将AreaID值更改为我需要的值" 2" " 3英寸


我的问题是它只适用于输入的第一个实例。我也在细节部分尝试了它并得到同样的问题。


请告诉我我做错了什么

谢谢

Dan
I have a report called rptCarSheet that is grouped on a field called ShiftID. In the ShiftID Group I have several fields that I am trying to input data by the following expression:

[exp] =IIf([AreaID]="1",[Employee]) [exp]

for each field I have changed the AreaID value the the value I need "2" "3" etc.

My problem is that it only works for the first instance entered. I have tried it in the details section as well and get the same issue.

Please tell me what I am doing wrong
Thanks
Dan



首先,您没有IIf语句的正确语法。一般语法是这样的:

= IIf(表达式,值如果为真,值则为假)


其次,如果AreaID是数字数据类型,你不要在返回值周围加上引号,引号用于文本数据类型。


所以试试你的IIf这样,假设你想要在Employee字段中返回值时AreaID = 1,如果AreaID不等于1,则需要返回exp字段中的值:


= IIf([AreaID] = 1,[Employee],[exp ])

First of all, you do not have the correct syntax for the IIf statement. The general syntax is like this:
= IIf(expression, value if true, value if false)

secondly, if AreaID is a numeric data type, you don''t put quotes around the return value, quotes are for text data types.

so try your IIf this way, assuming you want the value in the Employee field returned when the AreaID = 1, and you want the value in the exp field returned if the AreaID is not equal to one:

=IIf([AreaID]=1,[Employee], [exp])



首先,您没有IIf语句的正确语法。一般语法是这样的:

= IIf(表达式,值如果为真,值则为假)


其次,如果AreaID是数字数据类型,你不要在返回值周围加上引号,引号用于文本数据类型。


所以试试你的IIf这样,假设你想要在Employee字段中返回值时AreaID = 1,如果AreaID不等于1,则需要返回exp字段中的值:


= IIf([AreaID] = 1,[Employee],[exp ])
First of all, you do not have the correct syntax for the IIf statement. The general syntax is like this:
= IIf(expression, value if true, value if false)

secondly, if AreaID is a numeric data type, you don''t put quotes around the return value, quotes are for text data types.

so try your IIf this way, assuming you want the value in the Employee field returned when the AreaID = 1, and you want the value in the exp field returned if the AreaID is not equal to one:

=IIf([AreaID]=1,[Employee], [exp])



感谢您的回复,

实际上没有exp字段,这是我试图将表达式括起来的意外让它从我的帖子中脱颖而出。我的表达是

= IIf([AreaID] = 1,[WorkingOfficer])我已经从你说过的数字中删除了引号,因为AreaID是一个数字字段。然而,它仍然只适用于该组中的第一个字段。有什么想法吗?

Dan


Thanks for the reply,
Actually there is no exp field, that was an accident of my attempt to enclosed my expression to make it stand out from the rest of my post. My expression is
=IIf([AreaID]=1,[WorkingOfficer]) I have removed the quottes from the number as you said, because AreaID is a number field. HHowever it still only works for the first field in the group. Any ideas?
Dan



感谢您的回复,

其实那里是没有exp字段,这是我试图封闭我的表达以使其从我的帖子的其余部分中脱颖而出的意外。我的表达是

= IIf([AreaID] = 1,[WorkingOfficer])我已经从你说过的数字中删除了引号,因为AreaID是一个数字字段。然而,它仍然只适用于该组中的第一个字段。任何想法?

Dan
Thanks for the reply,
Actually there is no exp field, that was an accident of my attempt to enclosed my expression to make it stand out from the rest of my post. My expression is
=IIf([AreaID]=1,[WorkingOfficer]) I have removed the quottes from the number as you said, because AreaID is a number field. HHowever it still only works for the first field in the group. Any ideas?
Dan



你没有IIf语句的正确语法。一般语法是这样的:

= IIf(表达式,值如果为真,<<<值,如果为false>>>)


= IIf([AreaID] = 1,[WorkingOfficer],"")

you do not have the correct syntax for the IIf statement. The general syntax is like this:
= IIf(expression, value if true, <<<value if false>>>)

=IIf([AreaID]=1,[WorkingOfficer], "")


这篇关于为什么这不适用于我的报告?!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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