Oppolzer - Informatik / Blog


Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie

DB2-L - Fehler durch fehlenden Doppelpunkt vor Hostvariable

Subject:

Re: Compare Time stamp

From:

Bernd Oppolzer <bernd.oppolzer@T-ONLINE.DE>

Reply-To:

DB2 List <db2-l@lists.idug.org>

Date:

2010.04.27 21:27:00


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.
>

Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie