Suppose i have a Date column which has the date 31-JUL-2011.
Im getting the last date of the month using LAST_DAY(sysdate) which returns 31-JUL-11. But When i do a simple = comparison it does not give the result..i mean suppose tablename.lastdateofmonth = LAST_DAY(sysdate) it does not give the result but if i use tablename.lastdateofmonth = to_date(‘2011/07/31’, ‘yyyy/mm/dd’) it gives the result.
Thanks.
last day makes the current date as the last day of the month. however it keeps the time.
you must trunc the values if you are going to compare them by just day-month-year. Truncing them will solve your problem.