title: How to Get DateDiff by input id, at the same time SQL query?
body: <p><a href="https://i.stack.imgur.com/E6fXq.png" rel="nofollow noreferrer">MY DB TABLE</a></p>
  <p>My Current Code is..</p>
  <pre><code>SELECT DATEDIFF(DAY, Return_Date , Submit_Date )FROM Issue WHERE Book_ID = ?
  </code></pre>
  <p>But it shows a error that saying &quot;Incorrect parameter count in the call to native function 'DATEDIFF'&quot;</p>
  <p>Full code is</p>
  <pre><code>    Connection conn;
      Connct readerconn = new Connct();
      conn =readerconn.getConnection();
      
      
         try{
          String query = &quot;SELECT DATEDIFF(Return_Date , Submit_Date) FROM issue WHERE Book_ID = ?&quot; ;
          Double diff=null;
  
          PreparedStatement pstnt=conn.prepareStatement(query);           
          pstnt.setInt(1, Integer.parseInt( jTextField4.getText()));
          
          try (ResultSet rs = pstnt.executeQuery( query ) ;) {
          while ( rs.next ( ) ) {
              diff = rs.getDouble( 1 ) ;
              
              if(diff&lt;=7){
                  Double fine=diff-7*10;
                  fine = Double.valueOf(jTextField1.getText());
                  
              }
              else{
                  showMessageDialog(null,&quot;No Fine&quot;);                   
              }
          }
                      
          
          } catch ( SQLException ex ) {
              Logger.getLogger(ReturnNFines.class.getName()).log(Level.SEVERE, null, ex);
              showMessageDialog(null,&quot;Error&quot;); 
          }
  
          
      } catch (SQLException ex) {
          Logger.getLogger(ReturnNFines.class.getName()).log(Level.SEVERE, null, ex);
          showMessageDialog(null, &quot;Failed&quot;);
      }
  </code></pre>
  <p>im trying to get he id from JText filed and Find the DateDiff of the row , which has the input id,</p>