Created
April 22, 2021 12:08
-
-
Save Jviejo/8398734cd7cc56a04245c4161779451e to your computer and use it in GitHub Desktop.
problema de años entre dos fechas con firebird
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Supongo por la foto que la base de datos es firebird. | |
La documentación para obtener el numero de años dice que hay que poner | |
datediff(YEAR FROM FECHA_NACIMIENTO TO CURDATE()) | |
NO SE SI A LA HORA DE PONERLO EN LA INTERFAZ DEL PROGRAMA (QUE NO TENGO INSTALADO), SE PUEDE PONER ASÍ | |
O HAY QUE PONERLO | |
datediff(YEAR, "FECHA_NACIMIENTO", CURDATE) | |
Lo he pillado de https://firebirdsql.org/refdocs/langrefupd25-intfunc-datediff.html | |
DATEDIFF (<args>) | |
<args> ::= <unit> FROM <moment1> TO <moment2> | |
| <unit>, <moment1>, <moment2> | |
<unit> ::= YEAR | MONTH | WEEK | DAY | |
| HOUR | MINUTE | SECOND | MILLISECOND | |
<momentN> ::= a DATE, TIME or TIMESTAMP expression |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment