2 records with the same id number in query

rainbows

Registered User.
Local time
Today, 02:34
Joined
Apr 21, 2017
Messages
428
confused as to why i get 6 results yet only 5 in table and form
STOCK NUMBER gt2920 HAS 5 transactions the line numbers are 18.19.20. 24 and 26

the table also has 5 transactions

yet the results in the query has 6 ,, line 18 in twice

any idea what could be wrong ??

Thanks steve








1662981920484.png

1662982176281.png



1662982279183.png


1662982311746.png
 
And that is the only record that has two batch numbers?

Really would help if you showed the query sql? :(
 
i had not noticed that and yes it has done the same where i have 2 batch numbers to the same record. is it possible to only get the one record?


Code:
SELECT StockLevels.StockID, StockLevels.StockNo, StockLevels.OnOrderQty, StockLevels.Allocation, StockLevels.allocated, StockLevels.StockQTY, StockLevels.batchno.Value, StockLevels.batchno
FROM StockLevels
WHERE (((StockLevels.StockNo)=[Forms]![stocklevels]![Stocklist For Purchasing].[Form]![StockNumber]));
 
thanks for your help i have solved it the query had the field batchno.value in it , when i removed that it was ok


1662985584885.png
 

Attachments

  • 1662985545798.png
    1662985545798.png
    112.5 KB · Views: 89
Try modifying the query by entering DISTINCT.
Code:
SELECT DISTINCT StockID, StockNo, OnOrderQty, Allocation, allocated, batchno
FROM StockLevels
WHERE StockNo=[Forms]![stocklevels]![Stocklist For Purchasing].[Form]![StockNumber];
 
confused as to why i get 6 results yet only 5 in table and form
STOCK NUMBER gt2920 HAS 5 transactions the line numbers are 18.19.20. 24 and 26

the table also has 5 transactions

yet the results in the query has 6 ,, line 18 in twice

any idea what could be wrong ??

Thanks steve








View attachment 103168
View attachment 103169


View attachment 103170

View attachment 103171
It's worth pointing out that this table includes a Multi Value Field, BatchNo. And it also contains TWO values for BatchNo in the record which is repeated in the original query. That's not a coincidence. You are asking for the BatchNo.Value in the query, which returns both of those BatchNo values. Hence the repeated line in the query results. I would not have predicted it would be presented exactly the way it does, but it is totally predictable that it does return two lines for that record with two BatchNo values.
 

Users who are viewing this thread

Back
Top Bottom