473,407 Members | 2,598 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,407 software developers and data experts.

Query from the Aggregated Query with different projection

Hello All,

Below is how my data looks like
Branch Item Customer Sales
10 1 C1 300
10 1 C2 400
10 1 C3 200
10 2 C1 500
10 2 C3 300
10 3 C1 1200
With this Query

SELECT
BRANCH,
ITEM,
COUNT(DISTINCT Customer || '-' || Branch)
FROM
TABLE1
GROUP BY
BRANCH,
ITEM
HAVING
SUM(SALES) BETWEEN 1 AND 1000

The output will be

Branch Item CustomerCount
10 1 3
10 2 2

and

Item 3 will not come since the value is 1200.

Now I need the Distinct Customers who were part of that Query where
the distinct Customer Count is only 3 and not the Sum (5). Now how do
we get that value with the given query with all conditions applied.

Remember the SUM(SALES) should be applied to Branch And Item and from
that I need the distinct CustomerCount.
Any help is highly appreciated.
Jun 27 '08 #1
0 818

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sridharan | last post by:
Hello All, Below is how my data looks like Branch Item Customer Sales 10 1 C1 300 10 1 C2 400 10 1 C3 200 10 2 C1 500
0
by: David | last post by:
This might be a report question but I think it is more a query issue than a report. I am a novice at bothAccess reporting and queries and have been struggling to build the following. (Note using...
3
by: John | last post by:
I've read several prior posts in this group about using nz() to convert null values to zero; however, I'm not sure how/where to implement this function in my crosstab query. The crosstab query...
0
by: schan | last post by:
Hi there, I was wondering if someone could shed some light on a problem I have no idea on how to fix. I created an Excel Add-In that uses an ADO connection to an Access database on a file...
14
by: manny | last post by:
I wish I knew what this was called, and I could have made a more sensible subject. For that matter, I knew what it was called, I could have googled it! Anyway, let's I have a table with name,...
1
by: wakin | last post by:
When I place the following in my query ProductivityHours: IIf(!=85,actualtimeintounittime(),IIf(.=231,3,Sum(IIf(!=33,!/60,IIf(!=102 Or !=158 Or !=219,0,IIf(!>12 And...
0
by: Garmt de Vries-Uiterweerd | last post by:
X-posted to opera.page-authoring, because this is a bit Opera-specific for the moment. F'up to ciwas. I am playing around with dedicated styling for the projection media type.. Currently the...
0
by: =?Utf-8?B?QHdpbg==?= | last post by:
Hi there, Im trying to get the MIN(dDateTime) of a datatable in a dataset generated from a XML file. I have tried the .Select and .Compute methodes without success. drs =...
1
by: nico3334 | last post by:
I'm having trouble with a query using "MAX". In my query I'm trying to use 2 date columns as my criteria. Here is the format for each column: Date1: 01/01/2007 Date2: 200701 For my...
0
by: jllanten | last post by:
I will appreciate any help you can provide me. In the company where i work we have a project which creates about 4-5M records daily of stats. We're currently storing this data in a db named...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.