Skip to Content
0
Former Member
Oct 19, 2005 at 09:50 AM

Serial number query

249 Views

Hi,

Currently I'm in my trainingperiod and I'm busy with a query to search on serialnumbers to find the needed info with it. Currently I have the next code:

SELECT DISTINCT T1.IntrSerial, T1.ItemCode, T1.ItemName, T1.WhsCode, T1.CardName, T3.CardName

FROM OSRI T1, INV1 T2, OINV T3, SRI1 T4, OCRD T5

WHERE T1.ItemCode = T2.ItemCode

AND T1.CardName = T5.CardName

AND T1.IntrSerial IN

(SELECT IntrSerial

FROM OSRI T1

WHERE T1.IntrSerial = 'm54275f00075' )

'm54275f00075' = a serial number so that's something you don't have to add. I added that line for my own help so I don't have to type a serialnumber each time. To search I use this line: WHERE T1.IntrSerial = '[%0]' FOR BROWSE

Now the problem is that he's giving me many customers when I search on a serial, while this isn't possible. There can only be 1 customer who bought the product with that serial and not like 200. So my question is how do I get the right customer who bought the product that contains the serial I'm searching for?

Any help is appreciated.

Thank you in advance!

Friendly greetings,

Martijn