SELECT "Table".*,
DATEDIFF( 'mm', "BirthDate", CURRENT_DATE ) / 12
- CASE WHEN MONTH("BirthDate")=MONTH(CURRENT_DATE) AND
DAY("BirthDate")>DAY(CURRENT_DATE) THEN 1 ELSE 0 END AS "Age"
FROM "Table"
I tested that query literally with a table named "Table" having a date
column named "BirthDate" in both parsed mode and in direct SQL mode. It
selects all the table columns plus the calculated age.
I used the embedded HSQLDB 1.8 in LibO 3.3.4 under Linux.
--
View this message in context:
http://nabble.documentfoundation.org/Fw-LibreO-Base-is-lying-about-my-age-tp3749948p3758292.html
Sent from the Users mailing list archive at Nabble.com.
--
For unsubscribe instructions e-mail to: [email protected]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted