473,769 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dsum Use In Query

GD
tblFoo

FooId Name Number
1 One 1
2 Two 2
3 Three 3

The Following query produces the results I want, but it is not
updatable. I need at least the "Number" field to be updatable.

select Name, Number, (select sum(Number) from tblFoo) as TotalNumber
from tblFoo

So I tried:

select Name, Number, dsum ([Number], "tblFoo") as TotalNumber
from tblFoo

This produces:

Name Number TotalNumber
One 1 3
Two 2 6
Three 3 9

I obviously misunderstand how dsum is supposed to work and I was not
illuminated by the help file.

Any help is appreciated.

Nov 13 '05 #1
2 1929
GD
I did not seem to get any responses to my query below. It seems like a
simple thing (that I unfortunately am not getting), so perhaps I made a
posting etiquette mistake? If someone would tell me what I did wrong I
would certainly appreciate it.

GD wrote:
tblFoo

FooId Name Number
1 One 1
2 Two 2
3 Three 3

The Following query produces the results I want, but it is not
updatable. I need at least the "Number" field to be updatable.

select Name, Number, (select sum(Number) from tblFoo) as TotalNumber
from tblFoo

So I tried:

select Name, Number, dsum ([Number], "tblFoo") as TotalNumber
from tblFoo

This is updatable, but produces:

Name Number TotalNumber
One 1 3
Two 2 6
Three 3 9

I obviously misunderstand how dsum is supposed to work and I was not
illuminated by the help file.

Any help is appreciated.


Nov 13 '05 #2
GD <gy**********@j mjservices.com> wrote in message news:<i1******* **************@ fe2.columbus.rr .com>...
tblFoo

FooId Name Number
1 One 1
2 Two 2
3 Three 3

The Following query produces the results I want, but it is not
updatable. I need at least the "Number" field to be updatable.

select Name, Number, (select sum(Number) from tblFoo) as TotalNumber
from tblFoo

So I tried:

select Name, Number, dsum ([Number], "tblFoo") as TotalNumber
from tblFoo

This produces:

Name Number TotalNumber
One 1 3
Two 2 6
Three 3 9

I obviously misunderstand how dsum is supposed to work and I was not
illuminated by the help file.

Any help is appreciated.

In the examples in the help file the name of the field is surrounded
by double quotes. E.g., DSum("[Number]", "tblFoo"). The one you had,
used the value of [Number] in the current record as if it were in
every record. So it resulted in [Number] * RecordCount on that line.

James A. Fortune
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3353
by: Rolan | last post by:
I'm using Access 97 and need some assistance in sorting out a proper DSum expression, or maybe even DCount might be an alternative. I have tried numerous combinations, but with no apparent success. The DSum function relates to a subform (sfrmCost) with a text box (RefCost) which is intended to be the container for a total from a query (qryItems). The query has three number columns from the table (tblItems) of which I have an expression...
2
11594
by: Dalan | last post by:
I seemed to be having problems with structuring the use of NZ with a DSum expression. Having tried numerous variations of the expression without success, I'm asking for assistance. First some background (Access 97) - the DSum expressions are being used in grand total text boxes on the footer of a subform. And when viewing the subform in the linked main form the two grand total boxes display #Error if no entry had been made. Those with...
1
4157
by: Alex | last post by:
Acc 97 Hi, I have the following in my query which works well if it is all set to numbers on table design. But what I want to do is where it states MC (short for machine name) use the actual machine name of which there are 5 off. therefore, on the table design I flick it over to text mode.
3
3767
by: Mark Reed | last post by:
All, I have never used this function before and am not sure it what I need. Just to clarify, I have a report based on a query which has amoungst other field, wk, parea & packs_req. What I am trying to do is create a subreport for the main report which gives a generalised breakdown of the main report. For the gender of 'Ladies', there may be several parea's so I want to sum the packs_req for ladies only. (Gender is not a field I can use,...
4
2655
by: John Baker | last post by:
Hi: At the bottom of a report, I wish to sum all the amounts that appear in a field called Discount$ that appears on the report. I am not doing this summing in the query that supports the report because I have sprinkled the discounts amount into every record, and it only applies in the totals summary for each invoice. In any case, the Field is called Discount$ and the report is called RINV1Q1. How do I reference the field in the report...
3
2957
by: beppe005 | last post by:
I would like to calculate a total for all the field with the same in a query. I don't know how to set the "criteria" for this dsum function, it should be something like = but it doesn't make sense. The query is something like: +-- --- ---- ---- --- ---+ +--1-----Alpha-------a1----------------1------------4------------------+ +--1-----Alpha-------a2----------------3------------4------------------+
4
2081
by: stephena | last post by:
Hello all, hope someone can help. I recently built a report showing the distribution of money in and out of the company. Simplified version of which looks like: DECEMBER 2004 TELEPHONE SALES: INTERNET: TOTAL: £1200 £1000 £2200 I then built a sub-report showing adjustments, eg:
7
7518
by: Lewe22 | last post by:
I have a query pulling information from multiple tables, one of which contains a list of students with an auto number their assessment information and how long the assessment took in minutes . My query is quite complex, using many tables and containing various parameters based on another form to show a list of assessments specific to a student. I am trying to achieve a running total of alongside the assessment length in my query and am...
3
2075
by: majapa | last post by:
To start, here is my DSum expression: Develop: Nz(DSum(". & "] + . & "]","CSO","='Ability to Develop'")*-1,0) I actually have 4 of these, each one with a different option for . For more context, the . part is drawing from a separate reference table which cycles through plugging in the name for each DB_ and Ben_ field in the CSO table. What I want to do is add another layer of criteria, the field which exists in the same CSO table. I'd...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10210
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8869
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3956
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.