I don;t know SQL, so I am hoping that someone can provide me the SQL to copy and paste in order to merge all of the different unit price fields into one field called “merged_unit_price”. Please note that many of the unit price values are null, so I would prefer that the null values don’t get merged.
Thank you very much in advance, Nathaniel
SELECT p.ID AS Part_ID,
p.UNIT_PRICE,
d.UNIT_PRICE_1,
d.UNIT_PRICE_2,
d.UNIT_PRICE_3
FROM tbl_local_SYSADM_PART AS p
LEFT JOIN SYSADM_DISCOUNT_PRICE AS d
ON p.ID = d.PART_ID;
First off in your query make sure to exclude the
Nullvalues from you dataset. Cant remember if Access SQL uses Null or Nothing, so try it one way and see if it errors out.As well, i would suggest you learn more about SQL statements, in general and access, cause you have limited yourself to just 4
UNIT_PRICE‘s and will eventually have to increase your table field signature. If it were me, i would break this table into Join Table, so you can have multiplePart_ID‘s and multipleUNIT_PRICE‘s. Currently you are restricted with onePart_IDand figuratively just oneUNIT_PRICE(counting the 4 price fields as 1 record).