title: Hibernate QuerySyntaxException
body: <p>I am getting the exception </p>
  
  <pre><code>org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: dayofweek near line 1, column 155
  </code></pre>
  
  <p>Below is my function to query the table </p>
  
  <pre><code>    Session session = getSession();
      Query query = session.createQuery("select count(tex.task.id)" + " from " + TestExecution.class.getName() + " tex where tex.userId=:userId and " +
              "tex.executedAt &gt;= curdate()- interval dayofweek(curdate())+6 day and tex.executedAt &lt; curdate() - interval dayofweek(curdate())-1 DAY");
      query.setParameter("userId", userId);
      return (long) query.uniqueResult();
  </code></pre>
  
  <p>Please help me..</p>