Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.
Select Sum(Case when H.Inv_Dt >= 20110801 and Inv_Dt <= 20120731 Then Case when H.Orig_Ord_Type = 'C' then L.Qty_Ordered * I.Price_Ratio * -1 else L.Qty_To_Ship * I.Price_Ratio end Else 0 End) as LbsShippedYTD, Sum(Case when H.Inv_Dt >= 20100801 and Inv_Dt <= 20110731 Then Case when H.Orig_Ord_Type = 'C' then L.Qty_Ordered * I.Price_Ratio * -1 else L.Qty_To_Ship * I.Price_Ratio end Else 0 End) as LbsShippedAllLY, substring(H.ship_To_Addr_3,1,charindex(' ',H.Ship_to_addr_3)-2) as ShipToCity, H.Cus_No, H.Ship_To_Name, H.Inv_Dt from OEHdrHst_Sql H Inner Join OELinHst_SQL L On H.Ord_Type = L.Ord_Type and H.Ord_No = L.Ord_no and H.Inv_No = L.Inv_No Inner Join IMItmIdx_SQL I On L.Item_no = I.Item_No where H.inv_dt >= 20100801 and H.inv_dt <= 20120731 and substring(H.Ship_To_Addr_3,1,5) = 'PHILA' Group By H.Cus_No, H.Ship_To_Name, substring(H.ship_To_Addr_3,1,charindex(' ',H.Ship_to_addr_3)-2)
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|TSQL remove duplicates from different columns||14||50|
|exec SQL Server Change Tracking CurrentVersion() across dbs||6||24|
|Moving away from Access 2003 adp files||4||43|
|Retrieve data for an employee, their immediate reports and hierarchy up to the CEO||5||18|
Join the community of 500,000 technology professionals and ask your questions.