better db query interval to string