Zeros出现 [英] Having Zeros Appear

查看:68
本文介绍了Zeros出现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个计算每个课程的学生注册的查询。

问题是,如果注册为零,则整行不会显示为



我试过各种各样的解决方案,两者都不起作用:


IIf(IsNull([学生列表]。[注册]),",[学生列表]。[注册])


IIf(IsNull([学生列表]。[注册]),0,[学生列表]。[注册])


IIf([学生列表] ]。[ENROLLMENT] =" 0"),0,[学生列表]。[注册])


想知道是否有人知道如何解决这个问题。我正在使用Access 2002

和链接表。

Marcus

******

I am running a query that calculates student enrolment per course. The
problem is, if the enrolment is zero, the entire row will not be
displayed.

I tried a variety of solutions, neither of which work:

IIf(IsNull([STUDENTLIST].[ENROLMENT])," ", [STUDENTLIST].[ENROLMENT])

IIf(IsNull([STUDENTLIST].[ENROLMENT]),"0", [STUDENTLIST].[ENROLMENT])

IIf([STUDENTLIST].[ENROLMENT]="0"),"0", [STUDENTLIST].[ENROLMENT])

Wondering if anyone knows how to solve this. I''m using Access 2002
with linked tables.
Marcus
******

推荐答案

Marcus,

尝试Nz(([学生列表]。[ENROLLMENT],0).Nz是一个相当有用的函数

将替换一个值(实际上是任何值)为null。

-

Alan Webb
kn ******* @ SPAMhotmail.com

这不是IT,它's is is


" Marcus"< to ******* @ yahoo.ca>写在留言中

news:11 *********************@g14g2000cwa.googlegro ups.com ...
Marcus,
Try Nz(([STUDENTLIST].[ENROLMENT],0). Nz is a rather useful function which
will substitute a value (any value, actually) for a null.
--
Alan Webb
kn*******@SPAMhotmail.com
"It''s not IT, it''s IS"

"Marcus" <to*******@yahoo.ca> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
我正在运行一个计算学生每门课程注册的查询
问题是,如果注册为零,则不会显示整行。

我尝试了各种解决方案,两者都不起作用:

IIf(IsNull([学生名单]。[注册]),,[学生名单]。[注册])

IIf(IsNull([学生名单]。[注册]),0,[学生名单]。[注册])

IIf([学生名单]。[ENROLLMENT] =" 0",0,[学生列表]。[注册])

想知道是否有人知道如何解决这个问题。我正在使用Access 2002
链接表。

Marcus
******
I am running a query that calculates student enrolment per course. The
problem is, if the enrolment is zero, the entire row will not be
displayed.

I tried a variety of solutions, neither of which work:

IIf(IsNull([STUDENTLIST].[ENROLMENT])," ", [STUDENTLIST].[ENROLMENT])

IIf(IsNull([STUDENTLIST].[ENROLMENT]),"0", [STUDENTLIST].[ENROLMENT])

IIf([STUDENTLIST].[ENROLMENT]="0"),"0", [STUDENTLIST].[ENROLMENT])

Wondering if anyone knows how to solve this. I''m using Access 2002
with linked tables.
Marcus
******



请发布您的查询。没有查看你的查询,我想你

应该使用left join:


选择CourseName,Count(*)作为StudendCount从Course作为c left join

学生列表在c.CourseId = s.CourseId Group By CourseName

" Marcus" <到******* @ yahoo.ca>在留言新闻中写道:< 11 ********************* @ g14g2000cwa.googlegr oups.com> ...
Please post your query. Without looking at your query, I guess you
should use "left join":

select CourseName, Count(*) As StudendCount from Course as c left join
StudentList s on c.CourseId = s.CourseId Group By CourseName
"Marcus" <to*******@yahoo.ca> wrote in message news:<11*********************@g14g2000cwa.googlegr oups.com>...
我是运行一个计算每门课程学生注册的查询。
问题是,如果注册为零,则不会显示整行。

我尝试了各种解决方案,两者都不起作用:

IIf(IsNull([STUDENTLIST]。[ENROLLMENT]),",[STUDENTLIST]。[ENROLLMENT])

IIf(IsNull([学生名单]。[ENROLLMENT]) ,0,[学生名单]。[注册])

IIf([学生名单]。[ENROLLMENT] =" 0"),0,[学生名单]。[注册] )

想知道是否有人知道如何解决这个问题。我正在使用Access 2002
链接表。

Marcus
******
I am running a query that calculates student enrolment per course. The
problem is, if the enrolment is zero, the entire row will not be
displayed.

I tried a variety of solutions, neither of which work:

IIf(IsNull([STUDENTLIST].[ENROLMENT])," ", [STUDENTLIST].[ENROLMENT])

IIf(IsNull([STUDENTLIST].[ENROLMENT]),"0", [STUDENTLIST].[ENROLMENT])

IIf([STUDENTLIST].[ENROLMENT]="0"),"0", [STUDENTLIST].[ENROLMENT])

Wondering if anyone knows how to solve this. I''m using Access 2002
with linked tables.
Marcus
******



代码如下:

SELECT Count(SRS_CSECTION_STUDENTLIST_ASSOC.ENROLLMENT_LI ST_ID)AS

注册,SRS_COURSE.CODE,SRS_SECTION.CODE
FROM(SRS_STUDENT_LIST_ITEM INNER JOIN

SRS_CSECTION_STUDENTLIST_ASSOC

ON SRS_STUDENT_LIST_ITEM.STUDENT_LIST_ID =

SRS_CSECTION_STUDENTLIST_ASSOC.ENROLLMENT_LIST_ID)INNER JOIN

(SRS_SECTION INNER JOIN SRS_COURSE ON SRS_SECTION.COURSE_ID =

SRS_COURSE.COURSE_ID)ON

SRS_CSECTION_STUDENTLIST_ASSOC.COURSE_SECTION_ID =

SRS_SECTION.SECTION_ID

GROUP BY SRS_COURSE.CODE,SRS_SECTION.CODE;


Marcus

*********

The code is as follows:

SELECT Count(SRS_CSECTION_STUDENTLIST_ASSOC.ENROLLMENT_LI ST_ID) AS
Enrol, SRS_COURSE.CODE, SRS_SECTION.CODE
FROM (SRS_STUDENT_LIST_ITEM INNER JOIN
SRS_CSECTION_STUDENTLIST_ASSOC
ON SRS_STUDENT_LIST_ITEM.STUDENT_LIST_ID =
SRS_CSECTION_STUDENTLIST_ASSOC.ENROLLMENT_LIST_ID) INNER JOIN
(SRS_SECTION INNER JOIN SRS_COURSE ON SRS_SECTION.COURSE_ID =
SRS_COURSE.COURSE_ID) ON
SRS_CSECTION_STUDENTLIST_ASSOC.COURSE_SECTION_ID =
SRS_SECTION.SECTION_ID
GROUP BY SRS_COURSE.CODE, SRS_SECTION.CODE;

Marcus
*********


这篇关于Zeros出现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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