Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: date comparison problem
Philippe wrote:
>
> Hi Michael,
>
> EE_DATE is CHAR and not VARCHAR2. The date in this field looks like '981231
> ' and is greather than '981231'.
> Try :
>
> select distinct ee_date from engagement_expense
> where EE_DATE <= rpad(to_char( add_months( last_day( trunc(
> sysdate ) ),-1 ),'yymmdd' ),8)
> order by ee_date
>
> HTH
> Philippe
>
Thanks, that did the trick. I am so used to working with VARCHAR2 types, that I didn't think about the padding of blanks on the CHAR type causing the problem.
Thanks again.
Michael.
--
Michael A. Rothwell
Oracle DBA/Oracle Web Developer
Views expressed here are not those of my company - No - Wait - Since I am independent, I guess they are the views of my company. Received on Wed Jan 20 1999 - 12:13:42 CST
![]() |
![]() |