试图从一个领域获得2个不同的总和 [英] Trying to obtain 2 different sums from one field

查看:57
本文介绍了试图从一个领域获得2个不同的总和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的问题。开始开发这个数据库的人在完成之前就已经过世了。

这个数据库用于图表,呼叫记录。它包含以下字段:日期,位置,传入/传出,呼叫长度(持续时间),平均呼叫长度(平均持续时间)和总呼叫(呼叫计数)。


表是命名为Table1。在其中,我有一个名为Incoming / Outgoing的字段。在列中输入的所有内容都被输入为Incoming和Incoming。或外向。


另一个字段称为持续时间。并且每个拨入或拨出电话都包含一列(数字)分钟数。


我对通话计数和总持续时间没有问题。


我需要做的是创建一个单独显示传入分钟数和传出分钟数的报告。


我对Access 2007几乎没有经验,只是试图解决这个问题持续了大约2个月,依赖于MS Access 2007教科书以及我在Google上可以找到的任何东西。


有没有什么东西可以解决这个问题就在我面前我没有看到?

This is my problem. The person who started developing this databas passed away before finishing it.
This database is used to chart, Call Records. It has fields for: Date, Location, Incoming/Outgoing, Call Length (Duration), Average Call Length (Avg Duration), and Total Calls (Call Count).

The table is named "Table1.'' In it, I have a field called "Incoming/Outgoing" all entried in the columns are entered as either "Incoming" or "Outgoing.''

Another field is called "Duration" and contains a column of (numeric) numbers of minutes for each Incoming or Outgoing call.

I have no problem with Call Counts and Total Durations.

What I need to do is create a report that seperately shows the Sum of Incoming Minutes and Outgoing Minutes.

I have little experience with Access 2007 and have only been trying to resolve this problem for about 2 months, relying on a MS Access 2007 Textbook and whatever I can find on Google.

Is there something so simple to resolve this that is right in front of my face that i am not seeing?

推荐答案

如果字段没有传入,则使用case语句将值更改为0并对其进行求和。做同样的事情,除了传出。
Use an case statement to change the value to 0 if the field is not incoming and do a sum on that. Do the same thing except for outgoing.


你已经在SQL Server中发布了这个,并且Rabbit已经在此基础上回答了。我怀疑,你在一个错误的论坛上提出了一个Access问题(如果我错了,请纠正我)。因此,我将把它移到Access论坛。
You have posted this in SQL Server, and Rabbit has answered on that basis. I suspect though, that you put an Access question in the wrong forum (Please correct me if I''m wrong). I will therefore move this to the Access forum for you.


这将更难,因为你没有包括你已有的。在论坛上提问时必须这样做。现在我假设您有一个查询,其中包含相关字段的组合。


在您的QueryDef(访问保存的查询)中,您需要包含两个字段,两者都将在字段:表:下面的 Total:行中有 Sum
This will be harder because you haven''t included what you already have. A must when asking questions on a forum. For now I will assume you have a query which is GROUPed BY the relevant fields.

In your QueryDef (Access saved query) you would need to include two fields as, both of which will have Sum in the Total: row underneath Field: and Table: :
展开 | 选择 | Wrap | 行号


这篇关于试图从一个领域获得2个不同的总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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