title: Item Property in sales query
body: <p>I have a query for sales and i need to add item group property from OITG table. but couldn't find any direct link. I am a novice so really have no idea how to add Item group property in Below query. Please advise.</p>
  
  <pre><code>Select T0.[DocNum], 
         T0.[DocDate], 
         Case when T0.[ObjType] = 13 then 'INVOICE' when T0.[ObjType] = 14 then 'CREDIT NOTE' end as 'Type',
      T0.[CardCode], 
      T0.[CardName], 
      T1.[ItemCode], 
      T1.[Dscription],
      T1.[Quantity], 
      T0.[DocCur], 
      T1.[LineTotal] as 'Canadian, 
      Case when T1.[Rate] = 0 then T1.[LineTotal] else (T1.[LineTotal]/T1.[Rate]) end as 'Equivalent Value',
      Case when (T1.[Quantity] = 0 and (T1.[StockPrice]*T1.[Quantity])= 0 )  then T1.[LineTotal] else (T1.[INMPrice]*T1.[Quantity]) end as 'Sales - Net',
      (T1.[StockPrice]*T1.[Quantity]) as 'Cost',
      T1.[GrssProfit],
      Case when (T1.[INMPrice]*T1.[Quantity]) =0 then 0 else (T1.[GrssProfit]/(T1.[INMPrice]*T1.[Quantity]))*100 end as 'GP %age'
      FROM 
      OINV T0  INNER JOIN INV1 T1 ON T0.[DocEntry] = T1.[DocEntry]
      WHERE 
      T0.[CANCELED] = 'N' and
      T0.[DocDate]   &gt;= [%0] and
      T0.[DocDate] &lt;=[%1] and
      T1.[LineTotal] &lt;&gt; '0'
  
  and i want to add a below subquery to above query.
  
      src.ItemCode,src.ItemName,src.ItmsGrpNam
  
      from
  
      (select OITM.ItemCode,OITM.ItemName,OITG.ItmsGrpNam
  
      from OITM CROSS JOIN OITG
  
      where OITM.QryGroup1 = 'Y' and OITG.ItmsTypCod = 1
  </code></pre>