Access 2013数据表总计行显示SUM函数没有结果 - 错误 [英] Access 2013 Datasheet Total Row Shows no Results for SUM Function - Bug

查看:143
本文介绍了Access 2013数据表总计行显示SUM函数没有结果 - 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

链接到SQL表的可更新子表单显示在Access 2013的数据表视图中。已完成Totals行。子表单行源通过vba设置为Table。*,表单中有一些对象为子表单提供过滤器。

A updatable subform which links to an SQL table is shown in datasheet view in Access 2013. The Totals row has been enabled. The subforms rowsource is set via vba as Table.* and the form has a handful of objects to provide filters for the subform.

该表由nvarchar和money数据类型的字段组成。  ;数据可以分组,我们称之为"订单"。

The table consists of fields of both nvarchar and money datatypes.  The data can be group by, let's call it "an order".

对于一个订单,总计行工作并显示上述相应列的SUM;但是对于另一个订单,SUM不返回任何值(但是平均值,计数和其他函数都有)。 起初我以为
中的数据存在问题,但是没有。但是没有。 所有这些都是有效的,数字的,非空的值。

For one order the Totals row works and shows the SUM of the above corresponding column; yet for another order the SUM doesn't return any value (but average, count and the other functions do).  At first I thought there was a problem with the data in the column(s) to be calculated, but there wasn't.  All were valid, numeric, non-null values.

这里真的很奇怪。

然后我开始将旧的数据库与之相比较数据并发现用户已经更新了几个文本字段,因此我逐一将已更改的字段设置为NULL,以用于那些用户添加了信息的记录。 在已更新的4个字段
中,将其中2个字段的所有字段设置为NULL并未解决问题;但是,其他2个字段都没有。

I then started comparing an older db with the same data and found that a couple of the text fields had been updated by a user, so one by one I set the changed fields back to NULL for those records where the user had added information.  Of the 4 fields that had been updated, setting all of the fields for 2 of them to NULL didn't fix the issue; but, no so with the other 2 fields.

这是我找到的: 如果这两个字段中的任何一个(两个nvarchar(255)数据类型字段)都包含任何非NULL数据,则Totals SUM函数不显示任何内容。 如果两者都更新为NULL,则SUM返回正确的计算/结果。

Here's what I found:  if either of these two fields (both nvarchar(255) datatype fields) contain any non-NULL data, then the Totals SUM function shows nothing.  If both are updated to NULL, then the SUM returns the proper calculation/result.

哦,并且SUM对数据表中的所有数字列都失败,而不仅仅是一个。

Oh, and the SUM fails for all numeric columns in the datasheet, not just one.

我来回徘徊,取消字段并添加值(甚至是空格),每次总计行SUM函数都不会显示任何一个,如果这两个字段中的任何一个甚至只有一个记录与wasn' t null。

I went back and forth, Nulling the fields and adding back in values (even blanks) and every time the Totals row SUM function would show nothing if either of these two fields had even a single record with wasn't null.

有没有人知道是否有补丁或修复此问题?

Does anyone know if there is a patch or fix to this issue?

提前致谢。

推荐答案

嗨Siprios,

Hi Siprios,

>>如果这两个字段中的任何一个(两个nvarchar(255)数据类型字段)都包含任何非NULL数据,则Totals SUM函数不显示任何内容。 如果两者都更新为NULL,则SUM返回正确的计算/结果。

>> if either of these two fields (both nvarchar(255) datatype fields) contain any non-NULL data, then the Totals SUM function shows nothing.  If both are updated to NULL, then the SUM returns the proper calculation/result.

据我所知,Number支持总行数,十进制或货币,nvarchar不支持。当非数字列中存在null时,您的意思是数字连接上的sum函数失败了吗?我对这种情况进行了测试,但我没有通过
来重现你的问题。

As far as I know, the total row is supported for Number, Decimal or Currency, and it is not supported for nvarchar. Did you mean sum function failed on numeric conlumns when there is null in non-numeric column? I made a test with this situation, but I failed to reproduce your issue.

如果你可以分享我们的屏幕会很有帮助关于Access 2013中的表格设计的镜头,以及关于总行数据表视图的屏幕截图。

It would be helpful if you could share us a screen shot about table design in Access 2013, and a screen shot about your datasheet view with a total row.

最好的问候,

Best Regards,

Edward


这篇关于Access 2013数据表总计行显示SUM函数没有结果 - 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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