Skip to Content

How to get the last transaction of serila no

Hi All,

I have small issue, I need to create a query to get the last transaction in the (Serial no transaction report).
Or how can I know where's the serial available now?

I try using the Query:

SELECT T0.[ItemCode], T0.[DistNumber], T1.[WhsCode], T1.[LineNum], T1.[BaseType], T1.[BaseEntry], T1.[BaseNum], T1.[CardCode], T1.[Direction], T1.[BsDocType], T1.[BsDocEntry] FROM OSRN T0 Inner Join SRI1 T1 On T1.[ItemCode] = T0.[ItemCode] And T1.[SysSerial] = T0.[SysNumber] WHERE T0.[ItemCode] =[%0] And T0.[DistNumber]= [%1] ORDER BY T1.[LineNum]

any suggestion please.

Thanks,

capture.jpg (84.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jul 31, 2017 at 03:05 PM

    SELECT T0.[ItemCode], T0.[DistNumber], T1.[WhsCode], T1.[LineNum], T1.[BaseType], T1.[BaseEntry], T1.[BaseNum], T1.[CardCode], T1.[Direction], T1.[BsDocType], T1.[BsDocEntry] FROM OSRN T0 Inner Join SRI1 T1 On T1.[ItemCode] = T0.[ItemCode] And T1.[SysSerial] = T0.[SysNumber] inner join ( SELECT itemCode, sysSerial, MAX(linenum) LineNum FROM sri1 GROUP BY sysSerial, itemCode) t on t1.sysSerial = t.SysSerial and t1.LineNum = t.LineNum and t1.ItemCode = t.ItemCode Where T1.CardCode = [%0]

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 31, 2017 at 07:20 AM

    Hi,

    Try the standard report --> Serial Number Transactions Report

    Regards:

    Balaji.S

    Add comment
    10|10000 characters needed characters exceeded