end of day, still working on sql