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

data duplication in query

22
Hi again all, Im starting to feel like i live here...I have an issue with data duplicating in a query. I have been rolling around now for two days and about to throw the computer out. Here goes my issue following.

I have two tables
Product
Outgoing
(I have not made a relationship) the only fields the same in these two tables are type and date - further any way i do make a relationship no info displays in the query)

I have made a query pulling down from both product table and outgoing table. with the intent to show how many product items are left in stock.
Expand|Select|Wrap|Line Numbers
  1. [Qty]-[Qty out]
based on selecting the type in outgoing and Qty out with the Qty coming from the Product table. Now the query seems to be working and calculating correctly but I find that everything is duplicating - I have checked that it is doing so by the ID number can someone please give me a heads up on how i sort this prob...

the SQL for the outgoing query is as follows
Expand|Select|Wrap|Line Numbers
  1. SELECT OutgoingTBL.ID, OutgoingTBL.Date, OutgoingTBL.Type, OutgoingTBL.Size, OutgoingTBL.[Qty Out], [Qty]-[Qty Out] AS [Current Tyre Type in stock], OutgoingTBL.Freight, OutgoingTBL.[Cost Price], Products.QTY
  2. FROM OutgoingTBL, Products
  3. GROUP BY OutgoingTBL.ID, OutgoingTBL.Date, OutgoingTBL.Type, OutgoingTBL.Size, OutgoingTBL.[Qty Out], OutgoingTBL.Freight, OutgoingTBL.[Cost Price], Products.QTY;
thanking you in advance
Jun 30 '10 #1
1 1655
heart01
22
@heart01
Well it looks like I have the above issue working now. Perhaps I was too quick to jump into asking...what I did was made a relationship to the product and outgoing tables based on type as this is the field they both have in common. I tried all joins and found one that works. So i dont get duplication now and can select on type which in turn pulls down each outgoing entry for that type and provides a total remaining stock.
Jul 1 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Matt | last post by:
In ASP, when we pass data between pages, we usually pass by query string. If we pass data by query string, that means we need to use submit button, not by regular button, and the form will pass to...
0
by: Nils Benson | last post by:
Here's a strange problem: I have an arbitrary query that has calculated columns in its output. It could be a "SELECT TOP 1 * FROM ...", or a "SELECT STDEV(somefield) FROM ...". It doesn't matter...
4
by: Martin Lacoste | last post by:
Can I get field names to be returned as data in a query's results? E.g. I have 3 fields (City, Town, Village), and want the results to incorporate these as data, e.g.: City 2 Town 4...
2
by: aland | last post by:
I've got an Excel spread sheet with one row of id's and I'd like to use these in a query and put the results into Excel. Basically I'd like to do something like SELECT txtFileTitle, txtFileYear...
2
by: st_moose | last post by:
I have a query that the user inputs last name of the customer and wants the output to be a specific form (that form is the form that all the information is entered originally). How do I set up the...
3
by: Bryan Warren via AccessMonster.com | last post by:
I am creating a new database, that will contain 2 fields that will have the same data. The DB is an inventory of computers. the fields I want to duplicate are the "serial number" and the "computer...
0
by: mark | last post by:
I need to update two fields in a few hundred rows in a table. I'll be provided with a spreadsheet giving me the key field and the two new values for each row. In the past I've done this simply by...
14
by: kpfunf | last post by:
I have a select query that uses an "OR" join. With that join in place, I cannot edit the data in the query datasheet; if I delete the "OR" and only use one join, then I can edit the data. I read...
1
by: jaceyk | last post by:
Is it even remotely possible to update field names to the correct field name for the same table using a data definition query? We have a utility that spits out data in an Access database for use in...
0
by: CoreyReynolds | last post by:
Hello, I've been looking at this for probably five hours now and I'm loosing my mind. I'll start by just showing my end result of this query of mine, since it illustrates the problem. Here...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.