Subject | Re: [firebird-support] Query help |
---|---|
Author | Svein Erling Tysvaer |
Post date | 2006-11-02T15:17:05Z |
Sure it is,
select case when DateA > DateB then DateA else DateB end -
case when DateC < DateD then DateC else DateD end + 1
from ...
It's the first time I've used two case statements like this, thanks for
teaching me something new.
Set
yartax1 wrote:
select case when DateA > DateB then DateA else DateB end -
case when DateC < DateD then DateC else DateD end + 1
from ...
It's the first time I've used two case statements like this, thanks for
teaching me something new.
Set
yartax1 wrote:
> Hi,
>
> Is it possible to do next query without a procedure?
>
> Select max(DateA,DateB)-min(DateC,DateD)+1 as days from......
>
> DateA and DateC are start/end dates of a month.
> DateB and DateD are start/end dates of a employee contract.
>
> I want to now, how many days have the contract in that month.
>
>
> Thanks.
> Yartax