Relationships with two field

Denmla

Registered User.
Local time
Today, 23:13
Joined
Aug 9, 2012
Messages
13
Hi All,

I need help with reading data from table.
My product table "Baza" has two field with Barcode.
Barkod field is primary key and barkod2 field is non primary key.
See picture "Table Baza". The name in table is on Croatian.

I created query, when I scan barcode with scanner all data is show me on table.
I want to link the barcode and barcode 2 field to load me data no matter which barcode I scanned.
Can somebode chow me how can connect that two field ?
 

Attachments

  • Table Baza.jpg
    Table Baza.jpg
    59.2 KB · Views: 79
Assuming your scanned barcode is entered as a parameter to your query then simply use something like

Code:
SELECT * FROM Baza WHERE (Barkod = [ScannedCode]) OR (Barkod2 = [ScannedCode]) ;
 
Assuming your scanned barcode is entered as a parameter to your query then simply use something like

Code:
SELECT * FROM Baza WHERE (Barkod = [ScannedCode]) OR (Barkod2 = [ScannedCode]) ;

Thank you, I will try
 
Thank you for code it's working.
But, now I have new problem, if you see first picture "qSkenirano" I have one article ( artikl field ) two times because query show two barcod.
How can I write code to sum qty for that article and show me only the main barkod?
 

Attachments

  • sql qSkenirano.png
    sql qSkenirano.png
    7.9 KB · Views: 69
  • qSkenirano.png
    qSkenirano.png
    16.1 KB · Views: 77

Users who are viewing this thread

Back
Top Bottom