OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: query returning empty row

From: Dan Nelson (dnelsonallantgroup.com)
Date: Sun Jan 17 2010 - 18:36:48 CST


In the last episode (Jan 17), bharani kumar said:
> SELECT updateDate,cHospital,cHospital1,cHospital2 FROM med_patient WHERE
> cCurstatus!='completed' AND cMmrcashworker = '2' AND
> (cHospital = '1234' OR cHospital1 = '1234' OR cHospital2 ='1234') AND
> updateDate between '2010-01-01' and '2010-01-28' order by id desc
>
> I have one patient entry,and his updateDate is 2010-01-17 ,
>
> but my above query return empty row , Why ?
>
> ( Note --> my updateDate field is varchar type)

Perhaps his hospital ID is not 1234, or cMmrcashworker is not 2, or
cCurstatus = 'complete'. Try

 SELECT updateDate,cCurstatus,cMmrcashworker,cHospital,cHospital1,cHospital2
 FROM med_patient WHERE updateDate between '2010-01-01' and '2010-01-28'
 order by id desc

and verify that the other fields in your WHERE clause have the values you
think they do.

--
        Dan Nelson
        dnelsonallantgroup.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql