Translations:Faq/Base/121/5/da

From The Document Foundation Wiki
Jump to: navigation, search
SELECT "DateNaissance", 
CASE WHEN MONTH(CURRENT_DATE) < MONTH("DateNaissance") OR ( MONTH(CURRENT_DATE) = MONTH("DateNaissance") AND DAY(CURRENT_DATE) < DAY("DateNaissance") ) 
THEN CAST((YEAR(CURRENT_DATE) - YEAR("DateNaissance") -1) AS VARCHAR) || ' ans' 
ELSE CAST((YEAR(CURRENT_DATE) - YEAR("DateNaissance") ) AS VARCHAR) || ' ans'END AS "Age"FROM "Table1"