If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Forms SQL Query Question
I have a form that displays in tabular form a table. The form footer
contains a textbox that sums the 'amount' field. I want to add another textbox that displays the sum of the 'amount' of a query of records where another field is queried. For example. =SUM(Amount) WHERE City LIKE 'B%' I can't get this to work....is there something i'm doing wrong? Many Thx -- Gator -- Gator |
#2
|
|||
|
|||
Forms SQL Query Question
=?Utf-8?B?R2F0b3I=?= wrote in
: I have a form that displays in tabular form a table. The form footer contains a textbox that sums the 'amount' field. I want to add another textbox that displays the sum of the 'amount' of a query of records where another field is queried. For example. =SUM(Amount) WHERE City LIKE 'B%' I can't get this to work....is there something i'm doing wrong? Many Thx You can only use the sum() function in a totals query or on all the records in the form. If you need to obtain a filtered version of a sum, use the dSum() function unstead. It accepts 3 parameters, the field to sum, the name of the table or query which contains the field, and the Where clause less the WQhere keyword. = dsum("amount","queryName","City like 'B*'") Note that the % wildcard is used in some SQL dialects, in others, including Access, the equivalent is the * -- Bob Quintal PA is y I've altered my email address. ** Posted from http://www.teranews.com ** |
Thread Tools | |
Display Modes | |
|
|