[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: [sqr-users] Oracle Date Arithmetic
Try this
select to_char(add_months(since_dt,-1200),'dd-mon-yyyy')
from ps_customer
where cust_id = JD363258;
> I need to subtract 100 yrs from some dates.
> JD363258 14-FEB-2097
> needs to be 14-FEB-1997
>
> If I do an oracle query I get a March date in the correct year. I know
> this is due to leap year so I need to add a day for every day that's a
> leap year.
> Is there a quick and easy way to do this?
>
> select to_char(since_dt - 36500,dd-mon-yyyy')
> from ps_customer
> where cust_id = JD363258;
> SQL> /
>
> TO_CHAR(SIN
> -----------
> 11-mar-1997
>
> _______________________________________________
> sqr-users mailing list
> sqr-users@sqrug.org
> http://www.sqrug.org/mailman/listinfo/sqr-users
Bob Melosi x5-8427
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users