Click to See Complete Forum and Search --> : db2 compare timestamps


jrthor2
12-12-2005, 03:58 PM
I have a table that has a last_update_timestamp column that is a TIMESTAMP data type. I am writing a stored procedure where I am passing in a number of days, 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

chrismartz
12-13-2005, 09:51 PM
try WHERE last_update_timestamp <= (GETDATE() - v_NumDays)