How the expression will look depends on your data, most important your datefield format.
I would suggest to make seperate expressions first.
Expr1 = Sum(AmountField)
Expr2 = (DateField1 - DateField2)
Expr3 = (DateField1 - systemdate)
And then see whiche will work and which not.
Depending on the format of your date field you should convert them to a number field to make it easier to calculate with.