var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Dynamicaly generated where clause
I would like to select records from a table which YEAR value equals current year or current year + 1 and I don't want to hard code year values.
WHERE YEAR in (current year, current year +1)
I figured out how to get a current year:
SELECT YEAR (current timestamp) FROM sysibm.sysdummy1
but I'm having trouble incorporating that into where clause.
Could you please show an example how to do that?
Originally Posted by mt11
between is perhaps a "better" predicate than in for this.
where year in (year(current_date), year(current_date + 1 year))
Last edited by lelle12; 03-01-13 at 07:51.
Tags for this Thread