Need help w/ Crosstab query

ssmith001

Registered User.
Local time
Today, 11:03
Joined
Jun 6, 2006
Messages
29
Does anyone know how I can convert this Oracle crosstab query for use in Access? I was able to get the data to return the correct results using Oracle but I don't know how to write it using Transform and Pivot.

Code:
SELECT   y.process_date, y.loc dealer_code, l.p_dlrgrp dealer_grp,
         l.p_div division, l.p_countrycode country, y.plnrcode planner_code,
         y.ordertype, y.daysofsupply, 'SOF'
    FROM (SELECT   process_date, plnrcode, MAX (x.loc) loc,
                   MAX (x.ordertype) ordertype,
                   MAX (x.daysofsupply) daysofsupply
              FROM (SELECT TRUNC (insert_datetime) process_date, plnrcode,
                           DECODE (UPPER(param), 'LOC', VALUE) loc,
                           DECODE (UPPER(param), 'PROMOCODE', VALUE) ordertype,
                           DECODE (UPPER(param), 'DAYSOFSUPPLY', VALUE) daysofsupply
                      FROM pac.PROMO_PARAMS) x
          GROUP BY process_date, plnrcode
          ORDER BY 1, 2) y,
         stsc.loc l
   WHERE y.loc = l.loc
ORDER BY 1, 2
 

Users who are viewing this thread

Back
Top Bottom