title: How to query 180 days old user from repository using Spring Data JPA @Query annotation
body: <p>I want to retrieve all the user from User, who are 180 days older using Spring Data JPA @Query Annotation. Here is the query..</p>
  
  <pre><code>@Query("select user from User user where datediff(?1,user.createdTime)&gt;=180")
  List&lt;User&gt; findByCreatedDateMoreThanSixMonths(Date currentDate);
  </code></pre>
  
  <p>following is the calling Code.</p>
  
  <pre><code>List&lt;User&gt; userList = userRepository.findByCreatedDateMoreThanSixMonths(new Date());
  </code></pre>
  
  <p>Is this the way or am i missing anything? bcz doing so is not giving expected result.</p>