sql stuff working on missing hpms, etc