Path: news.cambrium.nl!textnews.cambrium.nl!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.68.MISMATCH!feeder.news-service.com!tudelft.nl!txtfeed1.tudelft.nl!newsfeed.kpn.net!pfeed08.wxs.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Date: Tue, 02 Feb 2010 09:03:05 +0100
From: Shakespeare <whatsin@xs4all.nl>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1
MIME-Version: 1.0
Newsgroups: comp.databases.oracle.server
Subject: Re: Oracle's months_between -function
References: <e8d5d9c4-89f0-45c6-82d4-86402b47c2f5@y12g2000yqh.googlegroups.com>
In-Reply-To: <e8d5d9c4-89f0-45c6-82d4-86402b47c2f5@y12g2000yqh.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 27
Message-ID: <4b67dc40$0$22913$e4fe514c@news.xs4all.nl>
NNTP-Posting-Host: 82.95.215.210
X-Trace: 1265097792 news.xs4all.nl 22913 [::ffff:82.95.215.210]:49465
X-Complaints-To: abuse@xs4all.nl
Xref:  news.cambrium.nl

Op 1-2-2010 14:39, eh schreef:
> Hi,
> is there an obviuos explanation to this case; months_between -function
> seems to act a little weird with time given:
> ===========
> select months_between(to_date('02.02.2010','dd.mm.yyyy'),to_date
> ('01.02.2010', 'dd.mm.yyyy'))
> from dual
> --->  0.0322
> ===========
> ... and then we add times to the mask
> ===========
> select months_between(to_date('02.02.2010 00:00:01','dd.mm.yyyy
> hh24:mi:ss'),to_date('01.02.2010 23:59:59', 'dd.mm.yyyy hh24:mi:ss'))
> from dual
> --->  7,467
> ===========
> How about that ???
> is it so simple that do not use time-format with monts_between .???
> BR,
> timo

Did you notice that the first calculation is 1 day, the latter 2 
seconds? And like Thomas stated: you're missing a part of your result 
because your column width is to small.

Shakespeare
