I'm trying to get the data of a document number in the last month but I'm not getting it. What did I do:
private DataIndicated getDataBetween(String numberDocument) {
LocalDateTime start = LocalDate.now().atStartOfDay();
LocalDateTime end = LocalDate.now().atTime(LocalTime.MAX);
return repository.findByDocumentAndDataBetween(numberDocument, start, end);
}
Repository:
DataIndicated findByDocumentAndDataBetween(String numberDocument, LocalDateTime start, LocalDateTime end);
Does anyone have an idea of how to make this query taking only the data of the document number of the last month?
I'm using Java 8 and SpringBoot 2.5.8
Thanks!