Convert SQL to MS Access
Hello everyone
Can anyone help me convert the sql statement below to a statement I can put into Microsoft access, or help me brake this down so I can put it into access.
Thanks
Corey
Code:
select 'FOX' PLATFORM
,dsd.site_id store_id
,dsd.locale
--, x.site_name Store_Name
, to_char(dsd.reporting_date,'DD') DD
, to_char(dsd.reporting_date,'MM') MM
, to_char(dsd.reporting_date,'YYYY') YYYY
, dsd.requisition_id Order_id
, dsd.product_id
, dsd.product_name name
, dsd.quantity quantity
--, round(dsd.unit_price,2) product_unit_price
, round(decode(dsd.reporting_state_type,'SHIPMENT',d sd.price,'RETURN_RECEIPT',-dsd.price,' '),2) Gross_Price
--xxx, u.price_per_qty_num Product_price
--xxx, round(((u.price_per_qty_num*ex2.exchange_rate/ex1.exchange_rate)*u.quantity),2) USD_Gross_price
--xxx, (select name from wkf_state where state_id = t.state_id) Order_Status
, decode(dsd.reporting_state_type,'SHIPMENT','COMPLE TED','RETURN_RECEIPT','RETURNED',' ') Order_Status
, dsd.program_id
, dp.description
, dp.program_name
, dp.MEDIA_TYPE
, dp.PROMOTION_TYPE
from dw_sales_data dsd, dw_programs dp
where dsd.program_id = dp.program_id
and dsd.program_id in ('115)
and to_char(dsd.REPORTING_DATE,'YYYY-MM-DD') between '2006-11-01' and '2006-11-30'
and dsd.reporting_currency = 'USD
|