I am looking to pull Gross Sales with discounts excluded. The query (below) is what I am running now, which provides Gross Sales + discounts (negative values)which is deflating our daily numbers.
select (b.net_sls_ttl) as AMOUNT, a.trans_seq as EXT_ID,
DATEPART( dd , a.end_date_tm ) as DAY ,
DATEPART( mm , a.end_date_tm ) as MONTH ,
DATEPART( yy , a.end_date_tm ) as YEAR ,
DATEPART( hh , a.end_date_tm ) as HOUR ,
DATEPART( mi , a.end_date_tm ) as MINUTE , a.rvc_seq as RVC, b.sls_itmzr_01 as CAT1, b.sls_itmzr_02 as CAT2, b.sls_itmzr_03 as CAT3, b.sls_itmzr_04 as CAT4, b.sls_itmzr_05 as CAT5, b.sls_itmzr_06 as CAT6, b.sls_itmzr_07 as CAT7, b.sls_itmzr_08 as CAT8, a.business_date from micros.trans_dtl a , micros.sale_dtl b where a.trans_seq = b.trans_seq and a.end_date_tm >= ? and a.end_date_tm <= ? order by a.end_date_tm
Any help is much appreciated.
Thank you!
select (b.net_sls_ttl) as AMOUNT, a.trans_seq as EXT_ID,
DATEPART( dd , a.end_date_tm ) as DAY ,
DATEPART( mm , a.end_date_tm ) as MONTH ,
DATEPART( yy , a.end_date_tm ) as YEAR ,
DATEPART( hh , a.end_date_tm ) as HOUR ,
DATEPART( mi , a.end_date_tm ) as MINUTE , a.rvc_seq as RVC, b.sls_itmzr_01 as CAT1, b.sls_itmzr_02 as CAT2, b.sls_itmzr_03 as CAT3, b.sls_itmzr_04 as CAT4, b.sls_itmzr_05 as CAT5, b.sls_itmzr_06 as CAT6, b.sls_itmzr_07 as CAT7, b.sls_itmzr_08 as CAT8, a.business_date from micros.trans_dtl a , micros.sale_dtl b where a.trans_seq = b.trans_seq and a.end_date_tm >= ? and a.end_date_tm <= ? order by a.end_date_tm
Any help is much appreciated.
Thank you!