Subject Re: Number of months between dates
Author lackonagy
--- In firebird-support@yahoogroups.com, "Martijn Tonies"
<m.tonies@u...> wrote:
>
>
>
> > > What is the way in FB to get number of months between two dates?
> >
> > extract(month from date2) - extract(month from date1)
> >
> > correct me if I'm wrong.
>
> What if month from "date1" is "11" and month from "date2"
> is "4" ...
>
> 4 - 11 = -7??
>
> While the difference actually is 5 months...
>
> With regards,
>
> Martijn Tonies
> Database Workbench - developer tool for InterBase, Firebird, MySQL
& MS SQL
> Server.
> Upscene Productions
> http://www.upscene.com

Right! I was trying to show the simplest way of getting the month out
of a date type variable. The rest are details.