Fixed a bug where the GetByTargetDate was not returning any records