Hi,
I'm using the virtual key and range below to return only historical SOP documents with a specific PO number, date range, and with an SOP Type of 2 (Order). For some reason, i'm getting both SOP Orders and Invoices. What am I doing wrong with this range?
Thanks,
Aaron
assign virtual_key as key for table SOP_HDR_HIST with KEY_OPTION_ALLOW_DUPLICATES using 'Document Date' of table SOP_HDR_HIST, 'SOP Type' of table SOP_HDR_HIST, 'Customer PO Number' of table SOP_HDR_HIST;
range clear table SOP_HDR_HIST;
clear table SOP_HDR_HIST;
set 'Document Date' of table SOP_HDR_HIST to '(L) Start Date'; {this is a local field that is populated by another script}
set 'SOP Type' of table SOP_HDR_HIST to 2; {Order}
set 'Customer PO Number' of table SOP_HDR_HIST to '(L) Search String'; {local field that user enters search criteria}
range start table SOP_HDR_HIST by number virtual_key;
set 'Document Date' of table SOP_HDR_HIST to '(L) End Date'; {this is a local field that is populated by another script}
set 'SOP Type' of table SOP_HDR_HIST to 2; {Order}
set 'Customer PO Number' of table SOP_HDR_HIST to '(L) Search String'; {local field that user enters search criteria}
range end table SOP_HDR_HIST by number virtual_key;
get first table SOP_HDR_HIST by number virtual_key;
while err() <> EOF do
{this next part fills a TEMP table to display results in a scrolling window, I've validated that this is working properly and that the range itself is pulling records with and SOP Type of both 2 and 3 for the PO number that I'm testing with.}
get next table SOP_HDR_HIST by number virtual_key;
end while;