I wrote this function before, but I can’t remember it, and it did not fall into version control. Now, more like sleep deprivation than anything else, I don't remember how to recover it.
Here is an idea. I have two tables: "regPrice" and "custPrice", with the common key "itemID". They both have a “price” column, and custPrice also has another “acct” key, so if the price exists in custPrice, it should return it. If there is no custPrice entry, it should return regPrice.
pseudo code:
if(select custPrice where acct = passedAcct and itemID = passedItemID) {
return custPrice;
else
return regPrice;
Any help would be appreciated.
source
share