总和查询 [英] Sum Query

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

问题描述

大家好,


我的目标是每月运行一份报告。报告中我想要的信息是字段的总和。实际上有6个不同的领域。我有一个查询以下代码

Hi all,

My goal is to run a report for every month. The information i want in the report is the sum of a field. Actually 6 different fields. I have a query with the following code

展开 | 选择 | Wrap | 行号

推荐答案

我要做的是创建一个包含两个文本框的表单,您可以在其中输入开始日期和结束日期。然后让您的查询引用您的标准表单。如果您需要报表上的日期范围,则可以使用报表的OpenArgs属性将值传递给报表,或者仅在报表的OnLoad事件中引用该表单,并将值分配给标题中的控件或类似的东西。
What I would do is create a form that has two textboxes in which you can enter a starting and ending date. Then have your query reference the form for your criteria. If you need the date range on your report, you can pass the values to the report using the report''s OpenArgs property or just reference the form in your report''s OnLoad event and assign the values to a control in your header or something like that.


我认为在概念中我明白你的意思。文本框是否应链接到基础表中的字段?通过这样做,它会根据该日期范围过滤我的报告?你能举个例子吗?感谢您的帮助。
I think in concept i understand what your saying. Should the textboxes be linked to fields in the underlying table? And by doing this it would filter my report based on that date range? Could you possibly give me an example? I appreciate your help.


表单和两个文本框都不会被绑定。为了便于说明,我将我的表单命名为frmSearch,并将我的两个文本框命名为txtStart和txtEnd。您的查询将是
Neither the form nor the two textboxes would be bound. For ease of illustration, I''ll name my form frmSearch and my two textboxes txtStart and txtEnd. Your query would then be
展开 | 选择 | Wrap | 行号


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

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