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

Group By

First I have to say I do not know SQL or VB very well...so if I'm able
to get this to work without learning a new language then I'll be
ecstatic.

OK...I have a tbl of approximately 1000 lines of data and about 20-30
columns each. The actual query itself is irrelevant, but I'm meshing
this up against multiple other tbls that I'm linked too. What I need
is this 1000 lines of data to remain in tact (at least what's left of
them) when the query is complete. However when it is complete the
1000 lines of data turns into 15000 lines of data. If anything I
should only see a fraction of the original 1000 records (maybe
300-400). I can't do group by on something so large and with so much
information.

There is one field that is distinct in every line of my original tbl.
How can I do a group by on that one field only though. I've seen the
SELECT DISTINCT command used before and tried to build that into my
SQL statement but it doesn't work. Should I "Make new table" with the
15000 lines and then build a new query with SELECT DISTINCT command,
if so what is the correct format if this is all I want it to do.

Thanks,
Shawn Stump
Nov 12 '05 #1
1 3064

"Shawn" <ss****@vartec.net> wrote in message
news:5b**************************@posting.google.c om...
First I have to say I do not know SQL or VB very well...so if I'm able
to get this to work without learning a new language then I'll be
ecstatic.

OK...I have a tbl of approximately 1000 lines of data and about 20-30
columns each. The actual query itself is irrelevant, but I'm meshing
this up against multiple other tbls that I'm linked too. What I need
is this 1000 lines of data to remain in tact (at least what's left of
them) when the query is complete. However when it is complete the
1000 lines of data turns into 15000 lines of data. If anything I
should only see a fraction of the original 1000 records (maybe
300-400). I can't do group by on something so large and with so much
information.

There is one field that is distinct in every line of my original tbl.
How can I do a group by on that one field only though. I've seen the
SELECT DISTINCT command used before and tried to build that into my
SQL statement but it doesn't work. Should I "Make new table" with the
15000 lines and then build a new query with SELECT DISTINCT command,
if so what is the correct format if this is all I want it to do.

Thanks,
Shawn Stump


Shawn, it's going to be difficult for anyone here to help unless you provide
more information. You might want to post the SQL that you are using. Are
you working in the Access query builder? From what you have provided, I
would say that SELECT DISTINCT is definitely not the solution to your
problem. It sounds as though you might be getting what is commonly termed a
Cartesian Product result. This is sometimes desirable but often not. It
can be a result of having tables in your query that are not properly joined.
Assuming that you are working in the Access query grid, begin by removing
all of the tables except for your primary data table. Build and run the
query, see if you get the desired set of records. If so, then add the next
table, create a join to the first table, then run the query again. Again,
see if you get the desired set of records. Then continue is this manner.

HTH,
Randy
Nov 12 '05 #2

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

Similar topics

2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
2
by: Tom Loach | last post by:
Our system administrator set up an NT server group in order to allow our users to login to our application via https to our sql server. The group appears as a User in SQL Server when you look at...
4
by: Chad Richardson | last post by:
I've always been mistified why you can't use a column alias in the group by clause (i.e. you have to re-iterate the entire expression in the group by clause after having already done it once in the...
2
by: BillD | last post by:
I'm trying to derive a schema from a base schema. I want to redefine a "group" from the base schema in my derived schema in order to add more options to the "choice" aggregate (see schema1.xsd...
16
by: michael | last post by:
Is it possible to get all href URLs contained in a unordered list and place them in an array? Or in fact two different arrays, differently named one for each <ul> group? <ul> <li><a...
7
by: Darin | last post by:
I have a report that sub-totals on a group, then grand-totals at the report footer. If there's only one group, the sub-total and grand total are redundant, so I only want to show one of them. I...
1
by: David Horowitz | last post by:
Hi folks. I need to create a report that has a Group Header that pulls certain data from the Detail section. It's something like this: +--Report---------------------------------------- |...
7
by: Sameh Ahmed | last post by:
Hello there IsInrole gives ya the means to check if the current or impersonated user belongs to a specific windows role or group. is there a way to do the same without using ADSI to check if...
2
by: jon|k | last post by:
hi all-- i need to do a transformation that removes duplicates (among other things). to accomplish that, i'm trying to use for-each-group, but it doesn't work. i need to select for duplicates by...
3
by: Sebastian | last post by:
Hello all I have a report where I have two nested groups. I know there are only three standard options for running sum: None, Over Group and Over All. I have a MyTextBox in detail section where...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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?
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
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
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,...

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.