day query working