DateAdd function is working fine as a sql query in sql-server as i want to substract some number of days from a date and i am getting result but while same i am using in jpa project, spring boot project has not started.
Below the repository class, if i comment out this below line of code, spring boot project starts as expected.
public interface domainRepository extends CrudRepository<domainTable , Long> {
@Query("Select DATEADD(day,-(1), d.date) from domainTable d "
+ "where d.id in (:id)")
public Date getDate(@Param("id") Long id);
}
How to fix this? or i do have to write a separate function instead of DATEADD?