Another solution that might work (leaving dateWorked as varchar)
 
SELECT * FROM agentdaily where STR_TO_DATE(dateWorked,'%M/%d/%Y') BETWEEN ....
 
As long as the date is in the format of mm/dd/yyyy that should convert the 
varchar output
to a date format, and allow the Between to work correctly.
 
Again, SHOULD....
 
Problem is if you changed the type from varchar to date, unless you reload the 
data, the
data that is in the table will be in internal date format, and probably was 
being ignored.
 
George
 
> To: [email protected]
> Subject: date range in mySQL not working
> Date: Fri, 11 Feb 2011 11:38:05 -0500
> From: [email protected]
> 
> 
> Hello all.
> 
> This simple query is not retrieving any records in mySQL:
> 
> SELECT * FROM agentdaily where dateWorked BETWEEN '10/01/2010' AND 
> '02/01/2011'
> 
> The data type for dateWorked in varchar.
> 
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/sql/message.cfm/messageid:3386
Subscription: http://www.houseoffusion.com/groups/sql/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/sql/unsubscribe.cfm

Reply via email to