Hi there, can any one help me? I am new to DB2 sql, I will be using
the case statement to make comparisons in the select but I cannot get
it to work. The query below is an example of the comaprison I am tring
to do, it is not returning any rows. The column qactdat is a numeric
field which holds a date in the form yyyymmdd.
select integer(substr( qactdat,5,2)),
integer((substr (qactdat,5,2)+1-1))
from qwfldat
where integer(substr( qactdat,5,2)) = integer((substr (qactdat,
5,2)+1-1))
If I remove the where clause, rows are returned. I cannot work out why
the comaprison is not evaluating to true, as they should both return
the same number.
Hope somone can help, many thanks,
Toby
the case statement to make comparisons in the select but I cannot get
it to work. The query below is an example of the comaprison I am tring
to do, it is not returning any rows. The column qactdat is a numeric
field which holds a date in the form yyyymmdd.
select integer(substr( qactdat,5,2)),
integer((substr (qactdat,5,2)+1-1))
from qwfldat
where integer(substr( qactdat,5,2)) = integer((substr (qactdat,
5,2)+1-1))
If I remove the where clause, rows are returned. I cannot work out why
the comaprison is not evaluating to true, as they should both return
the same number.
Hope somone can help, many thanks,
Toby
Comment