计算一个字段的总和

计算一个字段的总和

本文介绍了计算一个字段的总和!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 亲爱的所有人 实际上,我正在通过选择DATE来打印报告,并且正在为该日期的所有记录打印报告。 现在我有了一个字段我的表格中的比率,我想根据标准(在该日期)计算该RATE字段的总和。 使用以下代码打印我的报告没有任何问题: -Dear allActually 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 IntegerDo While Not rs.EOF x = x + rs.Fields(6).Value rs.MoveNextLoop DataReport1.Sections("Section5").Controls("label17").Caption = x Set DataReport1.DataSource = rs DataReport1.Show 它解决了这个问题。 SarfarazIt solved the problem.Sarfaraz 这篇关于计算一个字段的总和!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-01 23:41