| re: DATE function problems
"Corky" <mowere@konicabt.com> wrote in message
news:7e5571df.0312031235.122888c5@posting.google.c om...[color=blue]
> 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[/color]
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. |