expression for report total

C

cc

I am looking for the correct expression to use for this situation:

field [# of invites] - number field
field [2007 invitee] - yes/no check box

I want an expression that will sum [# of invites] if [2007 invitee] is
checked/yes.

Thank you.
 
A

Allen Browne

1. In query design, type this into a fresh column in the Field row:
Invites: IIf([2007 invitee], [# of invites], 0)

2. Depress the Total button on the Toolbar.
Access adds a Total row to the grid.

3. In the Total row under this field, enter:
Sum
 
C

cc

I tried what you wrote, but it is giving me a total of 1, and the total is
definitely more than 1. Any ideas what I have done wrong? Thank you.

Allen Browne said:
1. In query design, type this into a fresh column in the Field row:
Invites: IIf([2007 invitee], [# of invites], 0)

2. Depress the Total button on the Toolbar.
Access adds a Total row to the grid.

3. In the Total row under this field, enter:
Sum

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

cc said:
I am looking for the correct expression to use for this situation:

field [# of invites] - number field
field [2007 invitee] - yes/no check box

I want an expression that will sum [# of invites] if [2007 invitee] is
checked/yes.

Thank you.
 
A

Allen Browne

In query design view, choose SQL View on the View menu.
Copy the statement, and paste it as a follow up.
We can then see what you are working with.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

cc said:
I tried what you wrote, but it is giving me a total of 1, and the total is
definitely more than 1. Any ideas what I have done wrong? Thank you.

Allen Browne said:
1. In query design, type this into a fresh column in the Field row:
Invites: IIf([2007 invitee], [# of invites], 0)

2. Depress the Total button on the Toolbar.
Access adds a Total row to the grid.

3. In the Total row under this field, enter:
Sum

cc said:
I am looking for the correct expression to use for this situation:

field [# of invites] - number field
field [2007 invitee] - yes/no check box

I want an expression that will sum [# of invites] if [2007 invitee] is
checked/yes.
 
C

cc

In Report/Design View, I went to the field/properties/control and added the
expression you gave me there also and now it works. Thank you.

Allen Browne said:
In query design view, choose SQL View on the View menu.
Copy the statement, and paste it as a follow up.
We can then see what you are working with.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

cc said:
I tried what you wrote, but it is giving me a total of 1, and the total is
definitely more than 1. Any ideas what I have done wrong? Thank you.

Allen Browne said:
1. In query design, type this into a fresh column in the Field row:
Invites: IIf([2007 invitee], [# of invites], 0)

2. Depress the Total button on the Toolbar.
Access adds a Total row to the grid.

3. In the Total row under this field, enter:
Sum

I am looking for the correct expression to use for this situation:

field [# of invites] - number field
field [2007 invitee] - yes/no check box

I want an expression that will sum [# of invites] if [2007 invitee] is
checked/yes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top