16. august 2003 - 14:30Der er
9 kommentarer og 2 løsninger
Udelad felt i beregning i formular
Jeg har en formular, hvor jeg gerne vil summere kolonnevis, men jeg vil gerne have at man har mulighed for at udelade en række i beregningen. Derfor hvordan kan man udelade en række i en summering/beregning i en formular?
Du kan f.eks.bruge et Ja/Nej-felt i din tabel, som kan sættes til ja, hvis den pågældende post skal medtages i beregningerne. I forespørgslen skriver du ja under kriterier.
roose>what do you mean by "udelade en række i beregningen". What is the reason for doing this? Lets say you have a form showing one or more records and you want SUM the values of only some of the values in one of the columns then I would imagine that there is a reason for NOT wanting to include these records in the calculation. The form will very likley be based on either a table or a query. So you can use DSUM to make the calculation.
Note: "SomeField <> 'SomeValue'" is the same as the WHERE part in an SQL without the word 'WHERE' So here you will say which records you want in the calculation.
terry>When I get the result of my query, I want to be able to exclude outlayers from my sum and average calculations. Those arguments cannot be included in the query because they alone rely on an adhoc decision by the db-user.
fynbohans>jeg har lavet et flueben i min formular så jeg kan vælge de observationer fra, som ikke skal med i beregningen. Problemet er, at klikker jeg på blot ét af fluebenene markeres de allesammen - jeg får altså ikke knyttet fluebenet til den enkelte "entry" men til hele formularen.
Yes it is - I've made a new table with my query. When the value shifts from true to false another table is generated. This table contains the sum of the fields. In a field in my form I use the DSUM function you described.
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.