SELECT
CASE WHEN BUSINESS_ORG_ID='001' THEN CONVERT(DECIMAL(18,0),(DS_INVOICE_QTY/1000))
ELSE CONVERT(DECIMAL(18,0), DS_INVOICE_QTY) END AS [DS INVOICE QTY]
FROM DS_FINAL_TRANSFORMATION
WHERE BUSINESS_ORG_ID='001' AND INVOICE_DATE>='01/01/2009' AND INVOICE_DATE<='12/31/2009'
|