Hi, for calculating the last day of a given month I use this stored function with a DBDATE value of DMY4-:
Code:
CREATE FUNCTION "informix".endofmonth(dt DATE DEFAULT NULL)
RETURNING DATE;
IF dt IS NULL THEN
LET dt = TODAY;
END IF
LET dt = date(extend(dt, YEAR TO MONTH) +1 UNITS MONTH) -1 UNITS DAY;
RETURN dt;
END FUNCTION
DOCUMENT 'Function to return the last day of the current or given month';
This way I could use it in a query like:
Code:
BETWEEN endofmonth() +1 UNITS DAY AND endofmonth(date(extend(today, YEAR TO MONTH) +1 UNITS MONTH))
I've been used to the extend function for years so I don't use mdy as you can see. But I don't know if this way of date calculation solves your problem, I would think not.
Maybe your problems have somthing to do with the DATE format according to the DBDATE parameter being different from the mdy output but I don't consider that very likely. Check it out and also try an alternative way, like this one.
Good luck,
Hans