473,395 Members | 1,694 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,395 software developers and data experts.

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 1660

<h2****@gmail.comwrote in message
news:11*********************@y66g2000hsf.googlegro ups.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
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...
8
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...
10
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...
3
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...
8
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...
1
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...
22
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
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...
1
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.