Solved

Access 2007 Query

Posted on 2011-02-27
8
233 Views
Last Modified: 2012-05-11
Hi,
Attached SAMPLEV2.1.accdb .
I need to make a  query that do this:
list/give me ALL the rows in the table SubstractionList that the TOTAL-SUM of the (EmployeeReward+EmployerReward+CompensationReward) <0.02 WHERE FundCode AND ID is equal.
I appretiate having query in design view AND an vba code to learn from
0
Comment
Question by:drtopserv
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 40

Expert Comment

by:als315
ID: 34995012
Sample was not attached
0
 

Author Comment

by:drtopserv
ID: 34995024
0
 
LVL 9

Expert Comment

by:mayank_joshi
ID: 34995071
the following query should work:-

SELECT * from SubstractionList where (EmployeeReward+EmployerReward+CompensationReward) <0.02 and FunDCode=ID

Open in new window



0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 9

Expert Comment

by:mayank_joshi
ID: 34995080
The access file containing the required query as 'SQL' is attached.
SAMPLEV2.1.accdb
0
 

Author Comment

by:drtopserv
ID: 34995931
what i was saying by :
FundCode AND ID  is:
search through rows and check :
if the rows have same fundcode and same ID , go sum : EmployeeReward+EmployerReward+CompensationReward
then if the totalsum <0.02 then don`t display theses rows.
otherwise bring me it.
0
 
LVL 40

Accepted Solution

by:
als315 earned 500 total points
ID: 34996794
Try this query:
SELECT SubstractionList.ID, SubstractionList.FundCode, Sum([EmployeeReward]+[EmployerReward]+[CompensationReward]) AS Total_Sum
FROM SubstractionList
GROUP BY SubstractionList.ID, SubstractionList.FundCode
HAVING (((Sum([EmployeeReward]+[EmployerReward]+[CompensationReward]))>=0.02));

0
 
LVL 40

Assisted Solution

by:als315
als315 earned 500 total points
ID: 34996818
If first query will be saved as Q1, second will give all records with your condition:
SELECT SubstractionList.*
FROM Q1 INNER JOIN SubstractionList ON (Q1.FundCode = SubstractionList.FundCode) AND (Q1.ID = SubstractionList.ID);
0
 
LVL 40

Expert Comment

by:als315
ID: 34996864
Both queries
SAMPLEV2.1.accdb
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question