Subject | Re: [firebird-support] Firebird SQL built-in function DATEADD with negative argument |
---|---|
Author | Helen Borrie |
Post date | 2010-06-10T20:08:07Z |
At 12:40 AM 11/06/2010, Mike wrote:
DateAdd (MONTH, (-1 * Delta), DateLast)
./heLen
>When I use the DateAdd function in SQL it works OK with the following syntax:The third example is closest, but expressions passed as function arguments need to be isolated in brackets. Have you tried
>
> DateAdd (MONTH, Delta, DateLast)
>
>where Delta contains a number of months and DateLast contains a valid Date value.
>
>However, if I want to decrement the result I use the following syntax:
>
> DateAdd (MONTH, -Delta, DateLast)
>
>and I get "Dynamic SQL error expression evaluation not supported".
>
>I have tried -(Delta) ; -[Delta] ; [Delta]*-1 and so on but with no success.
>
>What is the correct syntax for subtracting using DateAdd? Or, is there a bug?
DateAdd (MONTH, (-1 * Delta), DateLast)
./heLen