Advertisement

07.08.2008 at 01:08AM PDT, ID: 23545753
[x]
Attachment Details

VB SQL - Combining Queries

Asked by andyb7901 in SQL Query Syntax, Microsoft Access Database

hi,

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??Start Free Trial
1:
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
[+][-]07.08.2008 at 01:16AM PDT, ID: 21951829

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 01:29AM PDT, ID: 21951891

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 01:44AM PDT, ID: 21951958

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 02:22AM PDT, ID: 21952125

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 02:37AM PDT, ID: 21952181

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Query Syntax, Microsoft Access Database
Sign Up Now!
Solution Provided By: cactus_data
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.08.2008 at 03:10AM PDT, ID: 21952294

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 03:11AM PDT, ID: 21952301

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628