oops, i've just sent it to mike. 

Sabine Richter wrote:
> 
> Hello Mike, hello Silvia,
> 
> I think, the statement you suggest, Mike, isn't right. It gives you only
> patients who are over 1 year in hospital. That means, who came before
> (or at) 2000-01-25 and left after (or at) 2001-01-30. I think, you
> didn't mean that, Silvia?
> I understood, you wanted the persons who came to hospital between
> 2000-01-25 and 2001-01-30 and that it doesn't matter when they left.
> That will be:
> SELECT * FROM table WHERE begin_date/admission_date >=2000-01-25 and
> begin_date/admission_date <= 2001-01-30;
> 
> I'm not familiar with mysql this moment, but perhaps, if admission_date
> is a timestamp, you have to extract the dateportion of the column.
> Admission date can be 2001-01-30-13h:23m:45s and that may be interpreted
> as greater than 2001-01-30. (I don't know if that's a problem in mysql,
> in other backends it is).
> 
> Best regards
> Sabine
> 
> mike wrote:
> >
> > Dra. Silvia Andreasi,
> >
> > SELECT * FROM table WHERE begin_date_column <=2000-01-25 and
> > 2001-01-30<= end_date_column;
> >
> > begin_date_column and end_date_column have to be date type columns.
> >
> > Mike
> > sql,mysql
> >
> > Dra. Silvia Andreasi wrote:
> >
> > > Hi,
> > >
> > > How can I get the columns between a given time interval? Something like: "
> > > The patients admitted between january 25, 2000  and  january 30, 2001"
> > > ??????
> > >
> > > I'm new to MySql and would like a suggestion from you...
> > >
> > > Best Regards
> > >
> > > Silvia
> > >
> >

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to