473,395 Members | 1,846 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.

Refining Results from a Query - Beginner Question

Hi, I'm very very new to access but hopefully I'm learning quickly. I need some help on what I think maybe as a result of me having a little tunnel vision on my database & confusing myself.

An example of what I've done...

I have several tables e.g.

Table 1
Product No.------------Stock Holding
A1-------------------------10

Table 2
Product No.-----------Date Despatched----------Qty Despatched
A1------------------------01/01/2010-------------------3
A1------------------------02/01/2010-------------------2

I link the two tables based on the product number & create a query which I want to show the following results...

Query Required:-
Product No.------------Stock Holding--------------Date Despatched----QtyDespatched
A1-------------------------10-------------------------------01/01/2010-------------3
---------------------------------------------------------------02/01/2010------------2

However the query is returning the following....

Query actually being returned:-
Product No.------------Stock Holding--------------Date Despatched----QtyDespatched
A1-------------------------10-------------------------------01/01/2010-------------3
A1-------------------------10-------------------------------02/01/2010-------------2

Hopefully its clear that my problem is the product no. & the stock holding figure are returned twice as a result of there being two despatch dates & qty's - what I actually want is for the fields where there is only one set of data to be blank/null, but where they do have more than one result to return to populate accordingly. Does this make sense & is it possible to somehow achieve this or do I need to re-think entirely how I'm trying to get to me results?

Thanks a lot for your time.
BEP
Jan 12 '10 #1
2 1524
TheSmileyCoder
2,322 Expert Mod 2GB
That is how the query works. I think in your case what you need to do, is create a report based on your query, and then add "Grouping" on the product ID.

I can't really outline the whole procedure here, but try to play around with it, and then return here if you have any specific questions.
Jan 12 '10 #2
nico5038
3,080 Expert 2GB
In a report there's a field property to "suppress duplicate values" when set to "Yes" the result will be as you want.

Nic;o)
Jan 12 '10 #3

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

Similar topics

6
by: Francisco | last post by:
I have this question: I have a simple search to a db, something like: "select description from games where year = '1990'" suppose I get 300 results, I would like to display this in pages of 30...
2
by: mmitchell_houston | last post by:
I'm working on a .NET project and I need a single query to return a result set from three related tables in Access 2003, and I'm having trouble getting the results I want. The details: ...
10
by: Jerim79 | last post by:
I need to take the output from a query and convert it to lower case. Here is the relevant code: $query="SELECT FNAME, LNAME FROM (table) WHERE FNAME=('$FName') AND LNAME=('$LName')"; $result =...
9
by: Kelii | last post by:
I've been trying to get this piece to work for a few hours, but have given up. I hope someone out there can help, I think the issue is relatively straightforward, but being a novice, I'm stumped....
4
by: cihpet | last post by:
Hallo, I am beginner, I want to show on page results of this query: $query="SELECT mr_prehlad.mr_id, mr_kontakt.nazov_mr FROM mr_prehlad RIGHT JOIN mr_kontakt ON mr_kontakt.id_mr=mr_prehlad.mr_id...
2
bugboy
by: bugboy | last post by:
Hi i'm a beginner at php and my simple web query page doesn't work.. i swear i had it working at one point but now i've come back to it it doesn't. • My form works • My DB connection works •...
3
by: Ken Fine | last post by:
This is a question that someone familiar with ASP.NET and ADO.NET DataSets and DataTables should be able to answer fairly easily. The basic question is how I can efficiently match data from one...
8
by: pteare | last post by:
Hello, I was wondering if someone might be able to help me. I’m a little stuck as to how to put the results of a query into a memo field. I run a ski chalet company and I have a bookings...
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
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
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
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...
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.