September 02, 2005, 02:18 PM
<We_Focus>Column Title
Hi All
DEFINE SALESWORK
MYYEAR/YYTM=DATEADD(DATEVAL,'M', 2);
END
I Want the Value of
MYYEAR in My Column Title
TABLE FILE EMPDS
SUM
MY1VAL AS '
MYYEAR '
BY
WID
END
=============================
We_Focus
September 02, 2005, 02:37 PM
k.laneAs it stands, you won't be able to do this. Technically speaking, you'd have to code it with a fieldname in the AS.
However, it doesn't work this way. Without knowing the nature of DATEVAL and MYYEAR, it's hard to say.
If MYYEAR will end up being a single distinct value, then you could do this:
TABLE FILE SALESWORK
SUM MAX.MYYEAR
ON TABLE SAVE AS MYYEAR
END
-RUN
-SET &MYYEAR.A20.
-READ MYYEAR &MYYEAR
TABLE FILE EMPDS
SUM MY1VAL AS '&MYYEAR'
BY WID
END
...Of course, the -SET &MYYEAR.A20. would depend on the actual length of the field being saved. If you run ran the request up to the -RUN (before the &MYYEAR), you should see the actual length of the SAVE file. It is this value that you would use in the -SET.
However, that being said, it depends on whether MYYEAR (from the define) will be a distinct value. If not, then you would probably want to do an ACROSS MYYEAR such as:
TABLE FILE EMPDS
SUM MY1VAL
BY WID
ACROSS MYYEAR
END
Ken
September 02, 2005, 02:46 PM
susannahwould SUM MY1VAL ACROSS MYYEAR AS ''
work for you?
September 12, 2005, 05:38 AM
<We_Focus>Hi
K Lane and Susannah
My Problem have been Sovled by K.Lane,s Method
Thanks for Both of your help
=========================================
We_Focus