I am writing a POS sales app and want to compare the expiry date of an item to the present month and notify the user that the item will expire soon [closed]

  Kiến thức lập trình
 String checkExpiryDate = "select expirydate from houseofdates.items where MONTH(expiryDate) ="
                   + " MONTH(CURRENT_DATE()) AND YEAR(expiryDate) = YEAR(CURRENT_DATE())";
           prepare = connect.prepareStatement(checkExpiryDate);
           result = prepare.executeQuery();
           
           if(result.next()){
               expiryDate = result.getString("expirydate");
                             
           }
                      
         if(chckExpiry.matches(expiryDate)){
                 
                alert = new Alert(Alert.AlertType.INFORMATION);
                alert.setTitle("Information Message");
                alert.setHeaderText(null);
                alert.setContentText("Item expiry date is " + chckExpiry );
                alert.showAndWait();
            }

I expect the expiry date to compare it to the present month and alert the user

New contributor

Adamu Ahmad Dalhat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

1

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT