Skip to Content
May 28, 2020 at 08:45 PM

Is it possible to join these two tables together?


I'm trying to join these two tables together, but I can't seem to get it to work:

Select T50."ItemCode", T50."Bin", T50."On Hand", T51."Counts Past 365", T51."Latest Count" from

(SELECT T0."ItemCode", T1."SL1Code" "Bin", Sum(T0."OnHand") "On Hand" FROM OITW T0 INNER JOIN OBIN T1 ON T0."DftBinAbs" = T1."AbsEntry" WHERE T0."WhsCode" like '01%%' GROUP BY T0."ItemCode", T1."SL1Code" ORDER BY T0."ItemCode", T1."SL1Code")

Left Join T51 on T50."ItemCode" = T51."ItemCode" 

(SELECT T2."ItemCode", Count(T0."CountDate") "Counts Past 365", Max(T0."CountDate") "Latest Count" FROM OINC T0  INNER JOIN INC1 T1 ON T0."DocEntry" = T1."DocEntry" Right JOIN OITW T2 ON T1."ItemCode" = T2."ItemCode" WHERE T2."WhsCode" like '01%%' and  T0."CountDate" >= Add_Days(Current_Date,-365) GROUP BY T2."ItemCode" ORDER BY T2."ItemCode")