fixes for mysql not having NULLS LAST functionality and date improvements on view