|
|
| Next: Margin probs in Word and Works |
| Author |
Message |
Jens R. Rasmussen External

Since: Oct 18, 2009 Posts: 2
|
Posted: Sun Oct 18, 2009 2:29 pm Post subject: Sum Archived from groups: microsoft>public>access>reports (more info?) |
|
|
I'm very new in access, so please forgive me for this simple question.
I have a table (called TILMELDING) containing a field called HVILKET. It can
have one of 2 values, i.e. "kommer" or "ikke kommer". Another field is HVAD
which contains a number, ie. 091003, 091004, 091005, and so on.
I have a report. When I start it I am requested to tell which numbers from
HVAD I would like to see. I choose for instance HVAD = 091004.
Now I get a listing of alle record which have the field HVAD = 091004. Some
of them have HVILKET = "kommer" and some others have HVILKET = "ikke kommer"
Now I would very must like to count the numbers in the list which have the
HVILKET = kommer.
I guess that I have to write something like
= Sum ( [Tilmelding]![Hvilket] <kommer>)
however this does not work, so my syntax is incoorect. Please help.
regards
Jens |
|
| Back to top |
|
 |
Duane Hookom External

Since: Feb 07, 2005 Posts: 1359
|
Posted: Sun Oct 18, 2009 8:48 pm Post subject: RE: Sum [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Set the control source to:
=Sum(Abs([Hvilket]="kommer"))
The expression in the middle: [Hvilket]="kommer" will result in either 0
for False or -1 for True. Abs() changes the negative to positive and Sum()
adds them.
--
Duane Hookom
Microsoft Access MVP
"Jens R. Rasmussen" wrote:
> I'm very new in access, so please forgive me for this simple question.
>
> I have a table (called TILMELDING) containing a field called HVILKET. It can
> have one of 2 values, i.e. "kommer" or "ikke kommer". Another field is HVAD
> which contains a number, ie. 091003, 091004, 091005, and so on.
>
> I have a report. When I start it I am requested to tell which numbers from
> HVAD I would like to see. I choose for instance HVAD = 091004.
>
> Now I get a listing of alle record which have the field HVAD = 091004. Some
> of them have HVILKET = "kommer" and some others have HVILKET = "ikke kommer"
>
> Now I would very must like to count the numbers in the list which have the
> HVILKET = kommer.
>
> I guess that I have to write something like
>
> = Sum ( [Tilmelding]![Hvilket] <kommer>)
> however this does not work, so my syntax is incoorect. Please help.
>
>
> regards
> Jens
> |
|
| Back to top |
|
 |
Jens R. Rasmussen External

Since: Oct 18, 2009 Posts: 2
|
Posted: Mon Oct 19, 2009 11:55 am Post subject: RE: Sum [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Thank you very much. It works, of course
Can you give me a link to a place where I can read about these functions, so
I do not have to bother you again with such elementary questions?
best regards
/jens
"Duane Hookom" wrote:
> Set the control source to:
> =Sum(Abs([Hvilket]="kommer"))
> The expression in the middle: [Hvilket]="kommer" will result in either 0
> for False or -1 for True. Abs() changes the negative to positive and Sum()
> adds them.
>
> --
> Duane Hookom
> Microsoft Access MVP
>
>
> "Jens R. Rasmussen" wrote:
>
> > I'm very new in access, so please forgive me for this simple question.
> >
> > I have a table (called TILMELDING) containing a field called HVILKET. It can
> > have one of 2 values, i.e. "kommer" or "ikke kommer". Another field is HVAD
> > which contains a number, ie. 091003, 091004, 091005, and so on.
> >
> > I have a report. When I start it I am requested to tell which numbers from
> > HVAD I would like to see. I choose for instance HVAD = 091004.
> >
> > Now I get a listing of alle record which have the field HVAD = 091004. Some
> > of them have HVILKET = "kommer" and some others have HVILKET = "ikke kommer"
> >
> > Now I would very must like to count the numbers in the list which have the
> > HVILKET = kommer.
> >
> > I guess that I have to write something like
> >
> > = Sum ( [Tilmelding]![Hvilket] <kommer>)
> > however this does not work, so my syntax is incoorect. Please help.
> >
> >
> > regards
> > Jens
> > |
|
| Back to top |
|
 |
Duane Hookom External

Since: Feb 07, 2005 Posts: 1359
|
Posted: Mon Oct 19, 2009 1:13 pm Post subject: RE: Sum [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Your question isn't all that elementary. I probably found the answer here
many years ago and just restate it regularly.
The solution depends on applying a couple different concepts together.
--
Duane Hookom
Microsoft Access MVP
"Jens R. Rasmussen" wrote:
> Thank you very much. It works, of course
>
> Can you give me a link to a place where I can read about these functions, so
> I do not have to bother you again with such elementary questions?
>
> best regards
> /jens
>
> "Duane Hookom" wrote:
>
> > Set the control source to:
> > =Sum(Abs([Hvilket]="kommer"))
> > The expression in the middle: [Hvilket]="kommer" will result in either 0
> > for False or -1 for True. Abs() changes the negative to positive and Sum()
> > adds them.
> >
> > --
> > Duane Hookom
> > Microsoft Access MVP
> >
> >
> > "Jens R. Rasmussen" wrote:
> >
> > > I'm very new in access, so please forgive me for this simple question.
> > >
> > > I have a table (called TILMELDING) containing a field called HVILKET. It can
> > > have one of 2 values, i.e. "kommer" or "ikke kommer". Another field is HVAD
> > > which contains a number, ie. 091003, 091004, 091005, and so on.
> > >
> > > I have a report. When I start it I am requested to tell which numbers from
> > > HVAD I would like to see. I choose for instance HVAD = 091004.
> > >
> > > Now I get a listing of alle record which have the field HVAD = 091004. Some
> > > of them have HVILKET = "kommer" and some others have HVILKET = "ikke kommer"
> > >
> > > Now I would very must like to count the numbers in the list which have the
> > > HVILKET = kommer.
> > >
> > > I guess that I have to write something like
> > >
> > > = Sum ( [Tilmelding]![Hvilket] <kommer>)
> > > however this does not work, so my syntax is incoorect. Please help.
> > >
> > >
> > > regards
> > > Jens
> > > |
|
| Back to top |
|
 |
|
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
| |
|
|