I am creating a table that is pulling information from a table that is already in existance. The current table contains sales information for a given date. The new table is going to take the current date and compare it to the sales from a year ago. The structure for the new table is CY_DATE, PY_DATE, ACCOUNT, ACCT_UNIT, SUB_ACCT, CY_AMT, CY_UNITS, PY_AMT, PY_UNITS.
I have gotten all fields populated except for the PY_AMY and PY_UNITS. It is a bit tricky because I am taking the date in PY_DATE and turning around and using the same table that was used to get the current year data. You also have to match the ACCOUNT, ACCT_UNIT, and SUB_ACCOUT exactly between the 2 tables. If anyone has any suggestions I would be so greatful. I have tried UPDATE with both INNER JOINS and WHERE and can't figure it out.
I have gotten all fields populated except for the PY_AMY and PY_UNITS. It is a bit tricky because I am taking the date in PY_DATE and turning around and using the same table that was used to get the current year data. You also have to match the ACCOUNT, ACCT_UNIT, and SUB_ACCOUT exactly between the 2 tables. If anyone has any suggestions I would be so greatful. I have tried UPDATE with both INNER JOINS and WHERE and can't figure it out.