Skip to content

Instantly share code, notes, and snippets.

@MarioCares
Created November 28, 2014 16:42
Show Gist options
  • Save MarioCares/0d6588b45c3333e3903e to your computer and use it in GitHub Desktop.
Save MarioCares/0d6588b45c3333e3903e to your computer and use it in GitHub Desktop.
SELECT
((YEAR(NOW())-YEAR(desde_at))+1) AS AGNOS_TRANSCURRIDOS,
(((YEAR(NOW())-YEAR(desde_at))+1)*20) AS DIAS_ASIGNADOS,
IF(
(YEAR(NOW())-YEAR(desde_at))<15,
0,
IF(
(YEAR(NOW())-YEAR(desde_at))<20,
5,
10
)
) AS DIAS_PROGRESIVO
FROM rrhh_orden_trabajo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment