List:General Discussion« Previous MessageNext Message »
From:Shaoping Xie Date:August 20 1999 4:04pm
Subject:Re: What am I doing wrong in this select?
View as plain text  
Check the data type of the MACHINE field. I suspect you have a char
type for the MACHINE field which causes the problem.

    Notice: machine='SCP18' is different from
            machine='SCP18   '


    Good luck!

    Shaoping


--- "Sean L. Gilley" <slg@stripped> wrote:
> 
> I'm very confused.  If I do the following select:
> 
>      select startdate,enddate,machine from
> sched_data where (startdate >= '1999-08-01 00:00:00'
>  and enddate < '1999-09-01')  and
> project_id='1-GSMPh4-(K_B)'
> 
> I get the following output:
> 
>     
> +---------------------+---------------------+-----------+
>      | startdate           | enddate             |
> machine   |
>     
> +---------------------+---------------------+-----------+
>      | 1999-08-31 00:00:00 | 1999-08-31 01:00:00 |
> SCP2      |
>      | 1999-08-02 00:00:00 | 1999-08-02 16:00:00 |
> SCP18     |
>      | 1999-08-03 00:00:00 | 1999-08-03 16:00:00 |
> SCP18     |
>      | 1999-08-04 00:00:00 | 1999-08-04 16:00:00 |
> SCP18     |
>      | 1999-08-05 00:00:00 | 1999-08-05 16:00:00 |
> SCP18     |
>      | 1999-08-06 00:00:00 | 1999-08-06 16:00:00 |
> SCP18     |
>      | 1999-08-01 00:00:00 | 1999-08-01 16:00:00 |
> GRAFITE_F |
>      | 1999-08-19 00:00:00 | 1999-08-19 16:00:00 |
> SCP18     |
>      | 1999-08-09 20:00:00 | 1999-08-09 23:00:00 |
> SCP10     |
>     
> +---------------------+---------------------+-----------+
>      9 rows in set (0.04 sec)
> 
> But if I do this select:
> 
>      select startdate,enddate,machine from
> sched_data where (startdate >= '1999-08-01 00:00:00'
>  and enddate < '1999-09-01')  and
> project_id='1-GSMPh4-(K_B)' and machine='SCP18'
> 
> I get:
> 
>      Empty set (0.00 sec)
> 
> What am I doing wrong?
> 
> Sean.
> 
> ---
> Sean L. Gilley
> slg@stripped
> 
> ---------------------------------------------------------------------
> Please check
> "http://www.mysql.com/Manual_chapter/manual_toc.html"
> before
> posting. To request this thread, e-mail
> mysql-thread10832@stripped
> 
> To unsubscribe, send a message to the address shown
> in the
> List-Unsubscribe header of this message. If you
> cannot see it,
> e-mail mysql-unsubscribe@stripped instead.
> 
> 

===
Shaoping Xie, Ph.D.
ITWEB, Inc.
410 8th Street, 3rd Floor
Hoboken, NJ 07030
Tel# 1-201-239-0444 (Work)
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

Thread
What am I doing wrong in this select?Sean L. Gilley20 Aug
  • What am I doing wrong in this select?Jani Tolonen20 Aug
    • Re: What am I doing wrong in this select?Paul DuBois20 Aug
Re: What am I doing wrong in this select?Shaoping Xie20 Aug