I cannot post the whole thing as it's several tabs long.
Here are the two tables with the discounts in them and the one field that's coming up blank (in the first table only) is the pos_discount_code:
"pos_sequence" as "pos_sequence",
"pos_item_code" as "Item Code",
"pos_quantity_f6" as "Quantity",
"pos_price" as "Price",
"pos_sequence"&'-'&"suffix_no" as "Line Item",
SQL SELECT *
FROM $(TBLPRE)pshist_i i JOIN $(TBLPRE)pshist_h h
on i.pos_sequence = h.pos_sequence;
description as "POS Discount Desc";
SQL SELECT *
Even before I added the psdiscount table to obtain the discount description, the field was still showing as blank. The codes are all in the psdiscount table - and they are loading correctly, but not "matching" with any of the ones in pshist_i - so there are no codes or descriptions matching any of the items. I also tried it against another database on a server...no dice there either. It's utterly bizarre.
Hi there, Ajay!
Thanks so much for your help. I misread your message and said this: "I do load pshist_h separately - that's the header record. The discount code is applied to just the detail/item record, so it comes from pshist_i only. I was then using it to get the discount code description, but even before I brought that table in, it was malfunctioning."
Then I realized that I was joining the tables based on the pos_sequence, which I really didn't need to (it was left over from something else I was working on and never removed!). The minute I removed that clause, it worked like a charm. I then realized that was what you had meant all along! Thank you so much! I am certain I'd have missed that detail entirely.