Avatar of gigifarrow
 asked on

Sum in my query not working.

I am trying to sum to fields in a query and it keeps going in a parameter code.

WaitingShop: DSum("OnSite","tblTempleFuelcellOnly")+([InShop])
Microsoft AccessSQL

Avatar of undefined
Last Comment
Jeffrey Coachman

8/22/2022 - Mon
Ess Kay

use sum instead of dsum
Jeffrey Coachman

What does this return?

What does this return?:
...is this a text value, or a string?
Jeffrey Coachman

Please clearly define: "not working"

In most cases a Parameter prompt is indicative of a misspelling.
So check your object names carefully, ...and make sure you are using the actual field name form the table, not the "caption".

I also see that there is no Join between the two tables in your query there...?
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck

On site means the vehicles that are at the company parkinglot. in shop are the ones that are inside being worked on. in shop is found by getting the total of dates. because there are dates when they go in shop. Onsite is found by getting the total of units because every vehicle has a unit whether it is in shop or on site. I see why i get a parameter is because I have the wrong name of the field it should be in shop date.

So how would I add a total of dates minus  a total of units to get waiting shop? or should I put this as another question?
Hamed Nasr


Select DSum("f1 + f2","tbl")
From tbl;
Jeffrey Coachman

The questions still remain:

What does this return?

What does this return?:
...is this a text value, or a string?

Why is there no join between the two tables?

If you do this as a query, what is returned?:
SELECT DSum("OnSite","tblTempleFuelcellOnly") AS SumOnsite, Inshop, DSum("OnSite","tblTempleFuelcellOnly") + InShop
FROM YourTable

This why we always ask for sample files.

It is always much faster than us spending time guessing what a simple query should return.
Make sense?

Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.

Sorry jeff I am totally wrong.

I have been asked  to take a excel spreadsheet and put it  into access. There about eight calculations that I need to do.
Here are my fields that I am dealing with:
Field                                    Example          
Production Number         135
In Shop Date                      12/12/12
Unit                                      A company
18 Steps                              That are checked off with a X
Complete                             an x is put there for that
Percentage Complete         x represent percentage and totaled to 100%
Date complete                         Date vehicle completed
Date returned                      Date returned to customer
Scope                                       amount of vehicles suppose to get that is entered in
Based on these fields I have to answer the following questions in a query that is going to probably by a cross tab query because I need it broken down by units.
1.Received by  each unit (which can be done by totaling the serial numbers for each separate unit)
2. Onsite(total of in shop and vehicles that don’t  have a shop date)
3. Waiting shop[in shope date minus vehicles that don’t have a in shop date.
4.inshop(count of dates in shop)
5. vehicle complete(total of dates completed
6. equalvelent vehicle:total of completed
7. percentage complete:scope divided by total completed
8. Awaiting return(perctage complete – the date that have been returned)
9. Returned (counted by the  total date returned)
So here is a snip of the excel spreadsheet
and the database with the query I am trying to do.
Jeffrey Coachman

<Sorry jeff I am totally wrong.>
No need to apologize...

I see that hnasr is back with us, ...so I will leave this to him...

I will monitor, just to see how he solves this, ..in case I misunderstood something.

Hamed Nasr

Sorry boag2000,
Looks like my understanding of the problem is incomplete and the uploaded sample added to the confusion.
You can greatly help in rephrasing and presenting the problem so tthat he author can verify it.
Few records and expected output will be helpful.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Jeffrey Coachman

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question