473,657 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Grouping Data Range

Could anyone please take a look at this?

I have a table with 3 columns: ID, ZIP and Count as below:

Original Table
ID ZIP Count
1 00001 12
2 00002 12
3 00003 11
4 00004 11
5 00005 11
6 00007 11
7 00008 11
8 00009 11
9 01008 14
10 01009 14
11 01010 15
12 01011 18
13 01012 18
14 01013 12
15 01014 12
16 01020 12
17 01021 12
I am trying to collapse the ZIPs into consecutive ZIP ranges for each
count. My results would look like the following:
Resulting Table
ID ZIP Start ZIP End Count
1 00001 00002 12
2 00003 00009 11
3 01008 01009 14
4 01010 01010 15
5 01011 01012 18
6 01013 01021 12
I tried using the TOTAL function in the query with FIRST and LAST and
GroupBy Count, but that will result the group on range in non-
consecutive format. For example, it will shows 00001 - 01021 with
count = 12, 00003-00009 with count 11 and etc.

I have more than 40,000 of zipz and I am trying to find a more
interactive way of grouping the range with minimal manual process.

Does anyone have any suggestions?

Thanks in advance for your input.

-HL

Mar 19 '07 #1
1 1710

<h2****@gmail.c omwrote in message
news:11******** *************@y 66g2000hsf.goog legroups.com...
Could anyone please take a look at this?

I have a table with 3 columns: ID, ZIP and Count as below:

Original Table
ID ZIP Count
1 00001 12
2 00002 12
3 00003 11
4 00004 11
5 00005 11
6 00007 11
7 00008 11
8 00009 11
9 01008 14
10 01009 14
11 01010 15
12 01011 18
13 01012 18
14 01013 12
15 01014 12
16 01020 12
17 01021 12
I am trying to collapse the ZIPs into consecutive ZIP ranges for each
count. My results would look like the following:
Resulting Table
ID ZIP Start ZIP End Count
1 00001 00002 12
2 00003 00009 11
3 01008 01009 14
4 01010 01010 15
5 01011 01012 18
6 01013 01021 12
I tried using the TOTAL function in the query with FIRST and LAST and
GroupBy Count, but that will result the group on range in non-
consecutive format. For example, it will shows 00001 - 01021 with
count = 12, 00003-00009 with count 11 and etc.

I have more than 40,000 of zipz and I am trying to find a more
interactive way of grouping the range with minimal manual process.

Does anyone have any suggestions?

Thanks in advance for your input.

-HL

Mar 19 '07 #2

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

Similar topics

1
2878
by: amber | last post by:
Hello, I have a report in VB.NET/Crystal Reports. I have a criteria form that users select between 2 different types of grouping (group by category or group by year). Can I programmatically change the grouping of a single report, based on the user's selection? Or do I have to create another report, with different grouping, and call it when user selects different grouping? Thanks, amber
8
1586
by: pkilambi | last post by:
hi if I have an array say x = , , ] I basically want to group regions that are non zero like I want to get the coordinates of non zero regions..as (x1,y1,x2,y2) which show the top left(x1,y1) and bottom right(x2,y2) corners of each group.hope i am clear.
10
32466
by: Mat | last post by:
Hi, I have a table with two column, date and data I would like to do a set of queries to generate statistics on the data, such as count(data) for month blocks and year blocks. What is the best way to accomplish this? dd/mm/yy date | data ---------------
3
2730
by: ahaque38 | last post by:
Hello. Using A2K SP3, I am having the following problem with a report using "Sorting and Grouping". I have recently added a grouping in the reports for "Category2<>'CONTRACTS'". I have reports at the plan (overall totals), department and division levels which have sorting and grouping implemented with this new
8
3508
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At the moment the printed output is usually going to Word. It's turning into an unholy mess, because I'm having to prepare umpteen different Word templates, and the queries that drive them, depending on what events a course has.
1
1205
by: Andrew | last post by:
All, Apologies if off topic. I'm new to .net, although an experienced programmer, and am working on the client end of a sql application. It holds every single request that goes through our internet server at work, and the application allows you to search and view this information. One of the main searches is to view the number of requests and filesize downloaded per day over a range of days. As you can imagine, the tables get quite...
22
1698
by: joh12005 | last post by:
hello, i'm looking for a way to have a list of number grouped by consecutive interval, after a search, for example : => , , , ]
4
1566
by: mantrid | last post by:
I have records from a database that are extracted with php and displayed in a table. Data in some of the fields is replicated eg something1,item1,somethingelse1 something1,item1,somethingelse2 something1,item2,somethingelse3 something1,item2,somethingelse4 something2,item1,somethingelse5
1
1248
by: Erik Nodland | last post by:
Hi Everyone, Just after some ideas and suggestions on how to do this. I have a large amount of numeric data which I would like to group given a distance as a parameter. IE. If my dataset was simply 1, 5, 9,10,11,16,17,25,29 and I pass in a distance of 2 then I would want to end up with groups like 1, 5, (9,10,11), (16,17) ,25,29 So is grouped because each number is within a distance of 2 from
0
8325
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8742
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8518
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8621
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7354
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6177
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1971
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.