I have created a simple database with a single date field & inserted the current date. What I need to do is alter the day portion of this date field to be a value of 01 if the day of the current month is less than 21, otherwise the value should be 20. Thanks..bill
Here's a sample of the code I am attempting to use:
Here's a sample of the code I am attempting to use:
Code:
code=DB2
-- drop date table
drop table REIMEB2.DATE_TABLE;
-- create date table
CREATE TABLE REIMEB2.DATE_TABLE (SELECTION_DATE DATE);
INSERT INTO REIMEB2.DATE_TABLE (SELECTION_DATE)
values (CURRENT DATE);
update REIMEB2.DATE_TABLE set day(SELECTION_DATE) =
(SELECT CASE DAY(CURRENT DATE)
WHEN < 21
then 01
else
then 21
end case FROM REIMEB2.DATE_TABLE);
SELECT * FROM REIMEB2.DATE_TABLE;
end code
Comment