如何在Webfocus报告中将变量用作字段?

时间:2014-04-30 21:29:20

标签: webfocus

我有一个报告,其中我将当前日期存储在变量中,并且我希望将其作为字段包含在报表中。我试过这个:

-SET &WORKDATE = AYMD(&YYMD,0,'I8YYMD') ;
-SET &SAVEDATE=EDIT(&WORKDATE,'99999999$');
.....
.....
BY
    '&SAVEDATE'  AS 'Date Rpt Run'

我也尝试过:

BY
    &SAVEDATE  AS 'Date Rpt Run'

两个都给我

(FOC003) THE FIELDNAME IS NOT RECOGNIZED: 20140430
BYPASSING TO END OF COMMAND

在报告中包含变量的正确语法是什么?如果重要的话,报告的输出是Excel。

1 个答案:

答案 0 :(得分:3)

你怎么试

-SET &BYTODAY = &YYMD;

DEFINE FILE TABLE1
BYDATE/I8YYMD = &BYTODAY;
END
TABLE FILE TABLE1
...
BY BYDATE
...