What is the error? Did you miss the colon in front of the host variable
v_NumDays?
If the error is a type error in the condition, you could cast the date on the
right side to a timestamp, using a builtin function. Or extract the date from
the timestamp on the left side.
Kind regards
Bernd
R.T. schrieb:
> Hi,
> I have a table that has a last_update_timestamp column that is a TIMESTAMP data type.
> I am writing a COBOL/DB2 program where I am passing in a number of days as a parameter,
> and I need the sql to return to me data based on the last_updated_timestamp <=
> current date - number of days passed in. Could someone help me? This is not working:
>
> where last_update_timestamp <= (CURRENT DATE - v_NumDays DAYS)
>
> Thanks
> R.
>
|