How is the Average Days to Pay calculated in AP Vendors?

SOLVED

Just wondering what tables and fields I need to calculate the "Average Days to Pay" that shows up under the AP Vendor record on the Activity tab? I tried the APVSM table but that doesn't seem to correspond with the data shown on the Activity tab.