Ask LibreOffice - RSS feedhttps://ask.libreoffice.org/en/questions/Questions and answers for LibreOfficeenThu, 24 Dec 2015 11:55:56 +0100How to calculate the numbers of days between two dates in a query in base?https://ask.libreoffice.org/en/question/62272/how-to-calculate-the-numbers-of-days-between-two-dates-in-a-query-in-base/How can I calculate the numbers of days between two dates in a query in base?
Simple example: In a query I have a field called **DateArrived** and another called **DatePurchase**. Both display fine.
I added a field called **NOW()** and it correct showed the current date on each record.
I then added a field called:
**DateArrived DatePurchase**
(..and Base converted it to:)
**"DateArrived" - "DatePurchase"**
..in order to calculate the number of days between the two dates. I got the error:
**SQL Status: 37000
Error code: -16
Wrong data type: java.lang.NumberFormatException in statement [SELECT "DatePurchase" "DatePurchase", "DateArrived" "DateArrived", "DateArrived" - "DatePurchase" "Days" FROM "T_Drives"]**
How can I resolve this please?TheDatabaseGuyThu, 24 Dec 2015 11:55:56 +0100https://ask.libreoffice.org/en/question/62272/