Why i cant see the formula in query?

Mark1982

Registered User.
Local time
Today, 13:49
Joined
Jul 12, 2018
Messages
37
I Did the Dsum Formula and its working and the result is good. but when I want to see Query Table in Design View so i cant see the dsum formula in my total field. its hide the formula. why?
why i cant see the Dsum Formula? how can i view it?
 
maybe you are talking about the Total (in total query).
DSum(), you have to type it, eg:

Fields: Total:Dsum("NumericFieldName", "TableName" [, Criteria])
 
Dear Arnel,

I am talking about Dsum in query:
Totalsum("NumericFieldName", "TableName" [, Criteria])
I type it in Query of the total field. and its give me the result good.
but when i go back to edit the same dsum function so i cant find it. i only see total abd the dsum formula its hide. but it working good.
but why i cant see the dsum formula which i enter it?
 
use SQL view, is it there?
maybe you need to compact/repair the db.
 
I'm not sure what this means
I want to see Query Table in Design View
.

As arnelgp said --try the SQL view of the query and post it.
 
i cant see the dsum formula in my total field. its hide the formula.

To answer this portion, ACCESS is not using the function DSum() to return the total amount.

In the underlying SQL you should see something like
Code:
SELECT SUM(column_name)
FROM table_name
WHERE condition;

and you won't see
Code:
MyTotal: DSum ( expr , domain [, criteria] )

How ever if you look at the two, DSum is effectively asking for the same values as the first example, so it would be rather redundant to create a second query inside the first to do what the first is doing.
 
Mark1982, you need to understand the two ways to SUM a field across a domain.

In the first case, you write an SQL AGGREGATE query where in the aggregate, you have a function like SUM, COUNT, MIN, MAX, AVG, and a few others. The SQL statement will include a SELECT clause that uses the aggregating keyword on a given field. There are restrictions on what other fields may be present because of the nature of aggregation. You will also have a FROM clause and possibly a WHERE clause.

In the second case, you call a DOMAIN AGGREGATE function such as DCount, DSum, DMin, DMax, DAvg, etc. The function will include a single field name, a domain (a table name or query name without the word FROM), and possibly a criteria (like a WHERE clause without the word WHERE). A domain aggregate function call, in this case, counts as an "ordinary" field with a name that you would have to assign if you are returning values to the query, though if instead you used it in a WHERE clause it would not have to be named like a field.

You would use one or the other in a given situation. It would be very rare to use both. You CAN use a domain aggregate inside an SQL query but it is NOT recommended due to inefficiency concerns, particularly for larger tables. If you actually used the Domain Aggregate function in a query, it should ALWAYS be visible in Design view or SQL view (but of course would be resolved to a value in Datasheet view). If you used the SQL Aggregate, it will also be visible in Design view in the grid area, and will also be visible in SQL view. Again, in datasheet view it will be a resolved SQL function that is a single value per record.
 

Users who are viewing this thread

Back
Top Bottom