"Corky" <mo****@konicabt.com> wrote in message

news:7e**************************@posting.google.c om...

This works:

db2 SELECT DISTINCT PROBLEM_OBJECTS.PROBLEM_ID FROM PROBLEM_OBJECTS

INNER JOIN PROBLEMS ON PROBLEM_OBJECTS.PROBLEM_ID =

PROBLEMS.PROBLEM_ID WHERE INTEGER(DAYS(CURRENT DATE) -

DAYS(PROBLEMS.CLOSE_DATE)) = 365 AND PROBLEMS.CLOSE_DATE IS NOT NULL

But this doesn't:

db2 SELECT DISTINCT PROBLEM_OBJECTS.PROBLEM_ID FROM PROBLEM_OBJECTS

INNER JOIN PROBLEMS ON PROBLEM_OBJECTS.PROBLEM_ID =

PROBLEMS.PROBLEM_ID WHERE INTEGER(DAYS(CURRENT DATE) -

DAYS(PROBLEMS.CLOSE_DATE)) > 365 AND PROBLEMS.CLOSE_DATE IS NOT NULL

The only difference is the comparison operator ( = vs. > )

Any ideas?

Thanks in advance,

Corky

I don't know the answer to your question, but I don't understand why you are

using the integer function since the days function returns the value in

integer format.

When you say "does not work." Does that mean you get an error or no data

returned.