Skip to Content
0
Former Member
Apr 22, 2014 at 07:09 AM

Query with sub functions

15 Views

Hi Experts,

I have tried the below query with sub select function. could any one help me to fix this ?

SELECT T0.[ItemCode], T0.[Dscription], T1.[OnHand],

(Select distinct sum(T0.InQty) from OINM where T0.ItemCode = OINM.ItemCode and T0.DocDate = '2012/08/18' ) as 'OB Stock'

FROM OINM T0 INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode

WHERE T1.[OnHand] > 0 GROUP BY T0.[ItemCode], T0.[Dscription], T1.[OnHand]

thanks in advance,

Regards,

Dwarak