473,750 Members | 2,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3084

"Shawn" <ss****@vartec. net> wrote in message
news:5b******** *************** ***@posting.goo gle.com...
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
14168
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 Smarty-2.6.7.tar.gz on a system running WindowsXP SP2. Apache and PHP tested out fine. After adding Smarty, I ran the following http://localhost/testphp.php
2
12692
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 it in Enterprise Manager. That said, I can not see the users associated with the group from Enterprise Manager, but know they can login to the database. The problem is this. When we login via the web we get access to the database without...
4
28824
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 select statement). I'm mostly a SQL hobbiest, so it's possible that I am not doing this in the most efficient manner. Anyone care to comment on this with relation to the following example (is there a way to acheive this without re-stating the...
2
3352
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 sample). schema1.xsd sample: <!-- Here is a clipped down version of the group I want to redefine. --> <xsd:group name="INSURANCESVCRQMSGS"> <xsd:choice> <xsd:element ref="HomePolicyAddRq" minOccurs="1" maxOccurs="1"/>
16
4450
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 href="lemurs.html">Lemurs</a></li> <li><a href="chameleons.html">Chameleons</a></li> </ul> <ul>
7
4540
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 know how to count the groups, then hide the report footer if there's only one group, but my problem is I want to hide the group footer (sub-total), not the report footer (because the report footer references what the grand total is for, which is...
1
7321
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---------------------------------------- | +--Group Header---------------------------------- | | Codes: XYZ, XXX, YYY
7
5604
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 "domain\user" belongs to "domain\group"? the reason is, when getting the "memberof" property of a user, then checking if it contains the desired group or not. this will only work if the user is a member of the group itself but not when he is a member...
2
5155
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 looking at the child node sequence (see sample below). note that when i do an xsl-message on the group-by expression inside the for-each-group, it has exactly what i'd like to group by listed, but i guess it doesn't like to have a sequence of...
3
4109
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 the data is summed over group. But the data is summed over the second group. When a new group begins MyTextBox value is resetting to zero. I need a running sum over the first group so when another second group begins MyTextBox value will
0
9001
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9583
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9396
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
9342
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
8263
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
6808
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
6081
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();...
1
3323
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2226
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.