Subject AW: [firebird-support] view and computation
Author Olaf Kluge
Hello Markus,



Thank you, exactly what I'm looking for!



Best regards.



Olaf





> **
> Hello,
>
>
> in a view, the following expression is possible :
> .(a.eingangsdatum+coalesce(c.zahldauer,0)) as FAE,.
>
> But how can I take the current date in relation? For example:
>
> cast((current_date - (a.eingangsdatum+coalesce(c.zahldauer,0))) as
integer)
> as FIN
>
> I would like to calculate when the payment will be due.
>

You are trying to subtract a date from another date. Not sure if they like
that :)
Have a look at DATEDIFF function:
http://www.firebirdsql.org/refdocs/langrefupd25-intfunc-datediff.html

There's also DATEADD if you want to add some other unit than day to a date:
http://www.firebirdsql.org/refdocs/langrefupd21-intfunc-dateadd.html

HTH,
Markus

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]