Simple Query on condition

  • Thread starter Azhar2008 via AccessMonster.com
  • Start date
A

Azhar2008 via AccessMonster.com

Hi all,
Again bothering you for a very simple thing.

I have a table Expenses having fields

ID, InvoiceNo, Date, Expense, Approved

Where Approved is a check box. I want to build a query (from Queries) such
that along with other things, my query shows Total Expenses off all invoices
and Total Expenses of approved invoices.

Can any body help me?

Thanks
 
A

Allen Browne

In query design view, depress the Total button on the toolbar.
Access adds a Total row to the design grid.

In the Total row under InvoiceNo, choose Group By.

In the Total row under Expense, choose Sum.

Type an expression like this in the Field row:
IIf([Approved], [Expense], 0)
In the Total row under this field, choose Sum.
 
A

Azhar2008 via AccessMonster.com

Thanks Browne,
You have given me detailed method. I have used this method and it gives me
solution.
Thanks again...


Allen said:
In query design view, depress the Total button on the toolbar.
Access adds a Total row to the design grid.

In the Total row under InvoiceNo, choose Group By.

In the Total row under Expense, choose Sum.

Type an expression like this in the Field row:
IIf([Approved], [Expense], 0)
In the Total row under this field, choose Sum.
Hi all,
Again bothering you for a very simple thing.
[quoted text clipped - 6 lines]
such that along with other things, my query shows Total Expenses off
all invoicesand Total Expenses of approved invoices.
 

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