Temp Tables Calculating Fields

  • Thread starter Thread starter aaedwa
  • Start date Start date
Status
Not open for further replies.
A

aaedwa

Guest
I am joining two tables and outputting to a csv file. This has worked ok, But I would like to create a calculated field (an integer field multiplied by a decimal field) and output that as one of the columns. I am struggling at the moment to calculate the field and store it.

CREATE TEMP-TABLE tth2.
tth2:CREATE-LIKE(buf-woins-hndl).
tth2:ADD-LIKE-FIELD("ttqtyhrs","work_order.est_ltime").
tth2:TEMP-TABLE-PREPARE("ordx2").
bh2 = tth2:DEFAULT-BUFFER-HANDLE.

FOR EACH wo_instr NO-LOCK:
bh2:BUFFER-CREATE.
bh2:BUFFER-COPY(buf-woins-hndl).
ASSIGN bh2:BUFFER-VALUE("ttqtyhrs") = bh2:BUFFER-VALUE ("craft_nbr") *
bh2:BUFFER-VALUE("std_hrs").
END.


I am trying store the result of the calculation in temp table field ttqtyhrs I get an error message

Invalid datatype for argument to method 'BUFFER-VALUE'. Expecting 'integer' (5442) when I try to compile.

I would be grateful for any pointers Andy

Continue reading...
 
Status
Not open for further replies.
Back
Top