Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

VB SQL - Combining Queries

Avatar of andyb7901
andyb7901 asked on
Microsoft AccessSQL
7 Comments1 Solution188 ViewsLast Modified:

I am trying to work out a few figures using my data. When I run my query I get my numbers back, but I do not think they are right. When I run a select query I get different results. I think ite because my query is adding on records rather than taking them away. What I want to happen is;

To find all accounts under a specific account type
Out of these accounts I only want accounts that are of a certain status
And then out of the reults of both of the above I only want to see accounts from a certain Location. (or in one case only in a certain location and in a certain LOB.

Can anyone help??
Sum(IIf(tbl_MIS_Records.[Account Type] In ("RegularAC","TopAC") And tbl_MIS_Records.Status In ("Approved","Not Approved","Mail Sent to requestor") And tbl_MIS_Records.Location In ("Moscow","Istanbul") Or ([Location]="Johannesburg" And [LOB]="Accounting"),1,0)) AS Result