Report question

B

Bianca

Hello,

I have created a report where one of the columns is "Status" where the
status can be Valid or Cancelled. I want the sum of the Valid and Cancelled
separately because then I have to subtract the two and get an average. Also I
would like to know how I can get these results on a separate page. I would
appreciate any help with this problem I am having!
Thanx
 
J

Jahanzaib

Bianca said:
Hello,

I have created a report where one of the columns is "Status" where the
status can be Valid or Cancelled. I want the sum of the Valid and Cancelled
separately because then I have to subtract the two and get an average. Also I
would like to know how I can get these results on a separate page. I would
appreciate any help with this problem I am having!
Thanx

Hi,
Use DCount function to do this.

In report footer add two text box.

For textbox1, set control source property to =DCount
("Status","table_name","Status='Valid'")
For textbox2, set control source property to
=DCount("Status","table_name","Status='Cancelled'")

JB
 
B

Bianca

Thanx a lot!

Jahanzaib said:
Hi,
Use DCount function to do this.

In report footer add two text box.

For textbox1, set control source property to =DCount
("Status","table_name","Status='Valid'")
For textbox2, set control source property to
=DCount("Status","table_name","Status='Cancelled'")

JB
 
B

Bianca

Im sorry to bother u again but I get a message saying that I entered an
invalid character or omitted something
this is what I entered same as yours - I actually copy pasted it!
=DCount("Status","PCA_Cards_Table","Status='Valid'")
is my table name too long or something?
 
J

John Spencer

Try typing it in instead of copy/paste. Sometimes the posting will pick up
extra characters that get copied.

What you posted looks correct. If you still get an error, try posting back
with the actual error message.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
B

Bianca

I typed it in the report and in another report just to see what would happen
- the error message is: "You omitted an operand or operator, you entered an
invalid character or comma, or you entered text without surrounding it in
quotation marks"
thanks
 
A

AccessVandal via AccessMonster.com

Hi,

Try with the square brackets, something like...

=DCount("[Status]","PCA_Cards_Table","[Status]='Valid'")

or

=DCount("[Status]","[PCA_Cards_Table]","[Status]='Valid'")


Is the table name with the underscore? Hope it's not corrected by Name
Autocorrect.

Note: "Status" is a reserved name in Access, it is used by ADO.
Im sorry to bother u again but I get a message saying that I entered an
invalid character or omitted something
this is what I entered same as yours - I actually copy pasted it!
=DCount("Status","PCA_Cards_Table","Status='Valid'")
is my table name too long or something?
[quoted text clipped - 16 lines]
 
B

Bianca

Thank u all for your help - but nothing seems to want to work here!! I even
went so far as to change the column name and the table name - and still it
does not want to work! The only thing I can think to do is to make two
separate reports and somehow get the results from both on the same page
somewhere.

AccessVandal via AccessMonster.com said:
Hi,

Try with the square brackets, something like...

=DCount("[Status]","PCA_Cards_Table","[Status]='Valid'")

or

=DCount("[Status]","[PCA_Cards_Table]","[Status]='Valid'")


Is the table name with the underscore? Hope it's not corrected by Name
Autocorrect.

Note: "Status" is a reserved name in Access, it is used by ADO.
Im sorry to bother u again but I get a message saying that I entered an
invalid character or omitted something
this is what I entered same as yours - I actually copy pasted it!
=DCount("Status","PCA_Cards_Table","Status='Valid'")
is my table name too long or something?
[quoted text clipped - 16 lines]
 
Top