How to calculate the numbers of days between two dates in a query in base? [closed]
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?
I've tried: DAYS(DateArrived; DateArrived) But this produces "Invalid expression"
I've trying: DAYS(DateArrived, DateArrived) But this produces "Access is denied: DAYS in statement [SELECT "DatePurchase" "DatePurchase", "DateArrived" "DateArrived", DAYS( "DateArrived", "DateArrived" ) "DayTwo" FROM "T_Drives"]
Pulling my hair out!!