title: compare 2 dates in a slick query seems hard
body: <p>helllo</p>
  
  <p>I can't adapt this example of code : <a href="https://github.com/pedrofurla/slick-demo/blob/master/src/main/scala/slickdemo/domain/Person.scala" rel="nofollow">https://github.com/pedrofurla/slick-demo/blob/master/src/main/scala/slickdemo/domain/Person.scala</a>.</p>
  
  <p>it deals with the capacity of comparing dates in a slick query. The difficulty is you can't access to the date field(to extract for example the year, the month and the day) because the query uses Column types.</p>
  
  <p>I searched and found the example above, but I can't adapt it.</p>
  
  <p>here is my code:</p>
  
  <p>the Table:</p>
  
  <pre><code>class Personnes( tag : Tag ) extends Table[ Rdv ]( tag, "RDV" ) {
  
       def id = column[ Int ]( "ID", O.PrimaryKey, O.AutoInc )
       def nom = column[ String ]( "NOM", O.NotNull )
       def prénom = column[ String ]( "PRENOM" )
       def sexe = column[ Int ]( "SEXE" )
       def télPortable = column[ String ]( "TELPOR" )
       def télBureau = column[ String ]( "TELBUR" )
       def télPrivé = column[ String ]( "TELPRI" )
       def siteRDV = column[ String ]( "SITE" )
       def typeRDV = column[ String ]( "TYPE" )
       def libelléRDV = column[ String ]( "LIBELLE" )
       def numRDV = column[ String ]( "NUMRDV" )
       def étape = column[ String ]( "ETAPE" )
       def dateRDV = column[ java.sql.Date ]( "DATE" )
       def heureRDVString = column[ String ]( "HEURE" )
       def statut = column[ String ]( "STATUT" )
       def orderId = column[ String ]( "ORDERID" )
  
       def * = ( id.?, nom, prénom, sexe, télPortable, télBureau, télPrivé,
          siteRDV, typeRDV, libelléRDV, numRDV, étape, dateRDV, heureRDVString,
          statut, orderId ) &lt;&gt; ( Rdv.tupled, Rdv.unapply _ )
  
    }
  </code></pre>
  
  <p>and the method:</p>
  
  <pre><code>def sqlite_findBetween( début : java.util.Date, fin : java.util.Date ) : List[ Rdv ]=  db_sqlite.withSession { implicit db : Session =&gt;
  
     def débutTime:org.joda.time.DateTime = new DateTime(début)
     def finTime=new DateTime(fin)
  
  
       val query = for {
          p &lt;- personnes
          if  (p.dateRDV &gt; débutTime &amp;&amp; finTime &lt; p.dateRDV)
       } yield p
       query.list
  
    }
  </code></pre>
  
  <p>thanks!</p>
  
  <p>ps : I forgot the error : near the date comparison, I get : </p>
  
  <pre><code>Cannot perform option-mapped operation with type: (java.sql.Date, org.joda.time.DateTime) =&gt; R for base type: (java.sql.Date, java.sql.Date) =&gt; Boolean
  </code></pre>
  
  <p>ps2 : here is the utility file : I have obviously added it in the classpath : <a href="https://github.com/pedrofurla/slick-demo/blob/master/src/main/scala/slickdemo/dal/JodaTimeSupport.scala" rel="nofollow">https://github.com/pedrofurla/slick-demo/blob/master/src/main/scala/slickdemo/dal/JodaTimeSupport.scala</a>, with this :</p>
  
  <pre><code>import models.JodaTimeSupport
  
  package models {
  
      trait sqlite extends JodaTimeSupport {...
  </code></pre>