remove date usage in query when not necessary