title: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near ')'
body: <p>Iam getting a error in String qquery when i run the code <code>Incorrect syntax near ')'.</code>  my sql qquery is running well in sqlserver he minus the products quantity .Any idea ? ty </p>
  
  <p>error log</p>
  
  <pre><code>at mylogin.Basket.makesales(Basket.java:160)
      at mylogin.Basket.ReceiptActionPerformed(Basket.java:455)
      at mylogin.Basket.access$100(Basket.java:23)
  </code></pre>
  
  <p>Here is my code </p>
  
  <pre><code>      public void  executeSQLQuery (String query,String message) {
          Connection con =getConnection();
          Statement st;
          try{
              st =con.createStatement();
              if((st.executeUpdate(query))==1)
              {
                 con.commit(); 
  
                 DefaultTableModel model=(DefaultTableModel)jTable_ProSales.getModel();
                  model.setRowCount(0);
                 show_Basket_in_Jtable();
                  JOptionPane.showMessageDialog(null,"Data "+message+" Succefully");
              }else{
                  JOptionPane.showMessageDialog(null,"Data Not "+message+ "Error");
              }
  
                  }catch (Exception ex){
                      ex.printStackTrace();
                  }
  }
  </code></pre>
  
  <p>action button</p>
  
  <pre><code> private void ReceiptActionPerformed(java.awt.event.ActionEvent evt) {                                        
          String query= "INSERT INTO Sales (Pro_Id ,Pro_Name,Sales_Quantity,Pro_Price ) SELECT Pro_Id,Pro_Name,Sales_Quantity ,Pro_Price FROM Receipt";
      executeSQLQuery(query,"Inserted");
    String qquery= " UPDATE Products SET Pro_Quantity= Products.Pro_Quantity - Receipt.Sales_Quantity FROM Products INNER JOIN Receipt ON Products.Pro_Id = Receipt.Pro_Id)" ; 
         executeSQLQuery(qquery,"updated");
      } 
  </code></pre>