PAHMA-1085: revisions to dates, etc. in SQL