Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL, Looking for help with Date stuff.
Simply use
where to_date(<misused column>,'MM/DD/YYYY') < ADD_MONTHS(sysdate,-5)
and that should be all
Hth,
Sybrand Bakker, Oracle DBA
Hank Janssen <hjanssen_at_dont.spam.me.com> wrote in message
news:933020710.728.75_at_news.remarQ.com...
> Greetings all,
>
> I am trying to come up with an elegant solution to a problem I am
> having.
>
> I am working within a DB of which the schema is part of a commercial
> system. This schema has fields in a table where I can store data that
> the commercial system will ignore. This table has a relation back to a
> customer account.
>
> This schema offers me 40 or so varchar(20) fields. And I am using one
> of these fields to store a date. (Which I format to MM/DD/YYYY).
>
> Now, I want to select from this table all records older than 5 months.
>
> But the field that I stored the date in is actually a varchar field
> (which I am limited to)
>
> Is there a nice way to write a select so I can still get all records
> older than 5 months.??
>
> Thanks!!!
>
> ----------------------------
http://www.anteus.com ---------------------------> EMAIL: hjanssen_at_anteus.com | reasonable and children respected their
> Hank Janssen. | When you get old, you to will fantasize
that
> Anteus Ltd. Seattle | Politicians where honest, prices where
![]() |
![]() |