Date arithmetic expression has an invalid operator

My equation is date-date/7 it seems it does not like to divide by 7 though. I am having issues running this expression in appsheet, I do believe it works in google sheets. I’ve tried changing the value from number to duration in appsheet with no luck. I still get invalid operator error

Please post a screenshot of the complete expression and of the error message.

[Loan Start Date] is type DATE

Subtraction operations between 2 values of any Date, Time, or DateTime Types produces a Duration Type. You cannot simply divide a Duration type. It looks like you’re wanting to calculate a number of weeks. Try:

TOTALHOURS( [date] - [date] ) / ( 7 * 24 )

And read this article thoroughly:


Excellent, it works using TOTALHOURS((today()-[Loan Start Date]))/ ( 7 * 24 ). Appreciate it! I’ll give that link a read, seems there is a slight difference between sheet and appsheet expression rules

1 Like

More than a slight difference. :slight_smile:

1 Like