rhunt
Well Known Member
Hello List,
I hate to bother you guys with a general DB2/400 SQL question, but I am having real issues with this. I am trying to write an oustide stored proc to read the F9312 weekly and provide data for a report (SOX Compliance). I don't have any JDE Report writing experience so I am trying to do this on AS400. The following syntax would work for MS SQL stored procs...can anyone tell me how to work this on the AS400?
DECLARE CURDATE CHAR(6),
DECLARE BEGDATE CHAR(6),
SET CURDATE = SELECT MAX(SHUPMJ) FROM SYS7333.F3912
SET BEGDATE = SELECT (MAX(SHUPMJ) - 7) FROM SYS7333.F9312
SELECT * FROM SYS7333.F9312
WHERE SHEVTYP = '01' AND SHEVSTAT = '02'
AND (SHUPMJ BETWEEN begdate AND curdate)
ORDER BY SHUPMJ, SHUPMT, SHUSER;
Thanks
Ryan Hunt
I hate to bother you guys with a general DB2/400 SQL question, but I am having real issues with this. I am trying to write an oustide stored proc to read the F9312 weekly and provide data for a report (SOX Compliance). I don't have any JDE Report writing experience so I am trying to do this on AS400. The following syntax would work for MS SQL stored procs...can anyone tell me how to work this on the AS400?
DECLARE CURDATE CHAR(6),
DECLARE BEGDATE CHAR(6),
SET CURDATE = SELECT MAX(SHUPMJ) FROM SYS7333.F3912
SET BEGDATE = SELECT (MAX(SHUPMJ) - 7) FROM SYS7333.F9312
SELECT * FROM SYS7333.F9312
WHERE SHEVTYP = '01' AND SHEVSTAT = '02'
AND (SHUPMJ BETWEEN begdate AND curdate)
ORDER BY SHUPMJ, SHUPMT, SHUSER;
Thanks
Ryan Hunt