计算一个字段的总和!

编程入门 行业动态 更新时间:2024-10-17 23:32:40
本文介绍了计算一个字段的总和!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

亲爱的所有人 实际上,我正在通过选择DATE来打印报告,并且正在为该日期的所有记录打印报告。 现在我有了一个字段我的表格中的比率,我想根据标准(在该日期)计算该RATE字段的总和。 使用以下代码打印我的报告没有任何问题: -

Dear all Actually i am printing a report by selecting a DATE and the report is being printed for all the records on that DATE. Now i have a field RATE in my table and i want to calculate the sum of that RATE field based on the criteria (on that date). My report is being printed without any problem using the below code:-

rs.Open "select * from patients where Receipt_date=#" & Label3.Caption & "#", Con, adOpenDynamic, adLockPessimistic Set DataReport1.DataSource = rs DataReport1.Show

但我想基于的计算该RATE字段的总和标准(在该日期) i希望将总金额放在数据集市上。 谢谢

but i want to calculate the sum of that RATE field based on the criteria (on that date) i want to put the total sum on a datareport. Thank you

推荐答案

Dim x As Integer Do not not rs .EOF x = x + rs.Fields(6).Value rs.MoveNext Loop DataReport1.Sections(Section5)。Controls(label17)。C aption = x Set DataReport1.DataSource = rs DataReport1.Show Dim x As Integer Do While Not rs.EOF x = x + rs.Fields(6).Value rs.MoveNext Loop DataReport1.Sections("Section5").Controls("label17").C aption = x Set DataReport1.DataSource = rs DataReport1.Show

亲爱的所有 我找到了问题的解决方案: Dear all I have found the solution to the problem: Dim x As Integer Do While Not rs.EOF x = x + rs.Fields(6).Value rs.MoveNext Loop DataReport1.Sections("Section5").Controls("label17").Caption = x Set DataReport1.DataSource = rs DataReport1.Show

它解决了这个问题。 Sarfaraz

It solved the problem. Sarfaraz

更多推荐

计算一个字段的总和!

本文发布于:2023-11-22 05:53:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1616214.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字段   总和

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!