Added new function to select rows corresponding to date