This block of code would not be entered if the startDate is null. It might be possible that a user specifies only an end date