Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL - table holds to dates, I want to retrive all dates in a period of time

Re: SQL - table holds to dates, I want to retrive all dates in a period of time

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Fri, 20 Feb 2004 14:49:47 +0100
Message-ID: <40360fe6$0$2437$626a14ce@news.free.fr>

"Anders F." <afromyr_at_hotmail.com> a écrit dans le message de news:b7aaadbb.0402200456.564ff0dd_at_posting.google.com...
> Hi
>
> My problem is that i have a table with a from_Date and a to_date.
> this table holds information about a persons sickdays.
>
> Lets say that the table contains the following info
> Employee - from_date - to_date
> 2604 - 14.02.2004 - 03.03.2004
> 5064 - 16.02.2004 - 17.02.2004
> 2604 - 01.01.2002 - 01.01.2002
> 2359 - 01.05.2003 - 01.05.2004
>
> I want to ask who whas sick between 01.01.2004 and 01.03.2004
> And get a list of all employees that has sickdays that is in this period
>
> Employee - from_date - to_date
> 2604 - 14.02.2004 - 03.03.2004
> 5064 - 16.02.2004 - 17.02.2004
> 2359 - 01.05.2003 - 01.05.2004
>
> How would I write the where sentence to get this info?
> select * from tbl where ?

These are those whose from_date or to_date are between 01.01.2004 and 01.03.2004 and those whose from_date is before 01.01.2004 and to_date after 01.03.2004. ;-)

Regards
Michel Cadot Received on Fri Feb 20 2004 - 07:49:47 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US