Changed the calendar database query