473,379 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Get consolidated data by joining two queries in to one

I have two queries which are containing one with sales data which is grouped is grouped by month, employee name, product name and sum of Sales Amount and secound query which is grouped by Month, Employee Name, product name and the assigned target.

Below is the [Sales Query] SQL view.
Expand|Select|Wrap|Line Numbers
  1. SELECT [Master Sales Query].[Branch Sales Name], [Master Sales Query].Month, [Master Sales Query].[Product Name], Sum(Nz([Net Sales],0)) AS Sales
  2. FROM [Master Sales Query]
  3. GROUP BY [Master Sales Query].[Branch Sales Name], [Master Sales Query].Month, [Master Sales Query].[Product Name]
  4. ORDER BY [Master Sales Query].[Branch Sales Name], [Master Sales Query].Month;
[Employees Target Query] SQL View
Expand|Select|Wrap|Line Numbers
  1. SELECT [pEmployees Target].[Branch Sales Name], Month([TargetDate]) AS [Month], [pEmployees Target].[Product Name], Sum(NZ([Target],0)) AS [Target YTM]
  2. FROM [pEmployees Target]
  3. GROUP BY [pEmployees Target].[Branch Sales Name], Month([TargetDate]), [pEmployees Target].[Product Name], [pEmployees Target].TargetDate;
Now I need to compare the each employees sales vs their assigned target with % of the acchivement in a pivot table.

Please any one could help me out?
Feb 23 '12 #1
2 1472
Rabbit
12,516 Expert Mod 8TB
You could join the queries to each other on your key fields.
Feb 23 '12 #2
Thanking you so much for the immediate & helpful answer. My problem has been solved now.
Feb 24 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

24
by: Ehud Shabtai | last post by:
Hi, I would like to store samples of data which are gathered from about 500 devices in mysql. Each device has its own data which changes over time. The data may be integer or float. The...
4
by: dschl | last post by:
Hi, I'm converting an Access 2000 database to Sql Server and must be missing something obvious. Using the Import utility in Sql Server, the Access queries seem to get executed and the...
0
by: glen | last post by:
While experimenting with telnetlib, Ive come across a couple of 'features' that confuse me a little (lot!). Could someone explain what "cooked data" is. Also when trying read_all() the program...
7
by: Dana Shields | last post by:
I am attempting to upsize from access to SQL Server. I'm trying to convert my queries to SQL Server views; however, I'm having a lot of difficulty with the syntax differences. For instance, a...
4
by: R | last post by:
Hi When an Access query is run against an ODBC table, is it possible in any way to tell what is passed to the server? I have a remote Sybase database linked into Access and the bandwidth is...
4
by: kevcar40 | last post by:
Hi i have a table which records the number of cards issued to a team fields are Team text Numof yellow integer numor Red integer date yellow short...
1
by: chris.thompson13 | last post by:
Any relevant advice would be most appreciated for the following problem I have. I have a query that draws its data from 7 other queries. I would like to be able to edit data through that query....
6
by: Serenityquinn15 | last post by:
Hi! I have a problem in my query... I want to join my two tables with the same date and returns in different records but it returns duplicate record.. Here is the examples: Table1: Field1 ...
6
by: inglesp | last post by:
I was wondering if anybody could help me with the following... which is related I think to my question here http://www.thescripts.com/forum/thread780631.html I have two queries which are based...
2
by: mborhanian | last post by:
Hello, As part of an application that I am trying to create thru MS Access, the user enters few parameters and based on that I would like the result of some predefined queries to be saved in an...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.