亲爱的所有人 实际上,我正在通过选择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
更多推荐
计算一个字段的总和!
发布评论