SELECT SALES_PERSON, ITEM_FAMILY, ITEM_CLASS, GBL_REVENUE_AMOUNT, INVOICED_DATE, COMPANY_CODE, SALES_COUNTRY, SALES_REGION,
CUSTOMER_NUMBER, SHIP_TO_STATE
FROM dbo.FACT_SALES_CQ AS fsc
WHERE (YEAR(INVOICED_DATE) > YEAR(GETDATE()) - 2) AND (MONTH(INVOICED_DATE) = MONTH(GETDATE())) AND (DAY(INVOICED_DATE) <= DAY(GETDATE())) AND
(REVENUE_RELATED_FLAG = 'Y') AND (COMPANY_CODE LIKE '2%') AND (COMPANY_CODE <> '210') AND (COMPANY_CODE <> '220') AND
(COMPANY_CODE <> '230') AND (COMPANY_CODE <> '280') AND (SALES_REGION <> 'LATIN AMERICA-L BARRIGA') AND
(SALES_REGION <> 'ASIA PACIFIC-RICHARD CHEN') AND (SHIP_TO_COUNTRY <> 'PL') AND (SHIP_TO_COUNTRY = 'CA' OR
SHIP_TO_COUNTRY = 'US') AND (DOVER_COMPANY = 'N') AND (ITEM_FAMILY <> 'CLEANENERGY FUELING PRODUCTS')