| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: integer division
On 30 Jun 1997 15:38:47 -0700, dalee_at_pelican.cs.ucla.edu (Daren Lee) wrote:
>hi
>
>does anyone know how to force integer division?
>
>i'm subtracting 2 DATE types to get the number of
>days between them and then i need to divide by 7.
>
>e.g:
>
>to_char(date1,'j')-to_char(date2,'j')/7
>
>thanks
>
trunc(date1-date2)/7
will do it. subtracting 2 dates gives you the number of days between. trunc it to get the whole number of days.
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD
http://govt.us.oracle.com/ -- downloadable utilities
![]() |
![]() |