Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. BEGIN
  2.  
  3. DECLARE noDays, diffDays INT;
  4.  
  5. IF (paidDate > dateGranted) OR ( paidDate <= maturityDate) THEN
  6. SET diffDays = DATEDIFF(paidDate,dateGranted);
  7. IF paymentTerm = "Weekly" THEN
  8. SET noDays = diffDays / 7;
  9. ELSEIF paymentTerm = "Semi Monthly" THEN
  10. SET noDays = diffDays / 15;
  11. ELSEIF paymentTerm = "Monthly" THEN
  12. SET noDays = diffDays / 30;
  13. END IF;
  14. END IF;
  15. RETURN TRUNCATE(noDays,0);
  16. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement