The strange behaviour is that if the date is correct it shows the value corresponding to the lower date for that code (Value 111 for Code 0000017) or a null value while it works when the closest day is not the one selected (Value 104 for Code 0000012)