Nevermind...you need a view. I don't think you can CREATE
VIEW.....CROSSTAB.
Dennis' method works. Here's an example where I've used it to create a
temporary view of some data by month....
CREATE TEMP VIEW vrawstock (jdecmpcd,boardname,jantons,febtons,+
martons,aprtons,maytons,juntons,jultons,augtons,septons,octtons,+
novtons,dectons) +
AS SELECT T1.jdecmpcd,T2.wvtrim +
(SUM((IFEQ((SGET(CTXT(T1.yyyymm),2,5)),'01',T1.plantons,0)))), +
(SUM((IFEQ((SGET(CTXT(T1.yyyymm),2,5)),'02',T1.plantons,0)))), +
(SUM((IFEQ((SGET(CTXT(T1.yyyymm),2,5)),'03',T1.plantons,0)))), +
(SUM((IFEQ((SGET(CTXT(T1.yyyymm),2,5)),'04',T1.plantons,0)))), +
(SUM((IFEQ((SGET(CTXT(T1.yyyymm),2,5)),'05',T1.plantons,0)))), +
(SUM((IFEQ((SGET(CTXT(T1.yyyymm),2,5)),'06',T1.plantons,0)))), +
(SUM((IFEQ((SGET(CTXT(T1.yyyymm),2,5)),'07',T1.plantons,0)))), +
(SUM((IFEQ((SGET(CTXT(T1.yyyymm),2,5)),'08',T1.plantons,0)))), +
(SUM((IFEQ((SGET(CTXT(T1.yyyymm),2,5)),'09',T1.plantons,0)))), +
(SUM((IFEQ((SGET(CTXT(T1.yyyymm),2,5)),'10',T1.plantons,0)))), +
(SUM((IFEQ((SGET(CTXT(T1.yyyymm),2,5)),'11',T1.plantons,0)))), +
(SUM((IFEQ((SGET(CTXT(T1.yyyymm),2,5)),'12',T1.plantons,0)))) +
FROM dpplan T1, wvtrim T2 +
WHERE (SGET(CTXT(T1.yyyymm),4,1)) = (CTXT(.vcurryr)) AND +
T2.nomadpc = T1.nomadpc +
GROUP BY T1.jdecmpcd,T2.wvtrim
Dawn Hast
[email protected] wrote on 06/19/2009 03:45:46 PM:
> Group,
>
> I need to construct a view that compares actions by an employee
> made last week to this week. So it's a single table view and
> would look something like
>
> EmpName 06/09/2009 06/16/2009 Result
> Joe Shmoe 1 1
> Snuffy Smith 1 1 2
>
> I'm drawing a blank.
>
> Jan
DISCLAIMER: This electronic message together with any attachments is
confidential. If you are not the intended recipient, do not copy, disclose or
use the contents in any way. Please also advise us by return e-mail that you
have received the message and then please destroy. Evergreen Packaging is not
responsible for any changes made to this message and / or any attachments after
sending by Evergreen Packaging. We use virus scanning software but exclude all
liability for viruses or anything similar in this email or any attachment.