Jump to content

Handling Dates in Mysql BETWEEN AND


Colton.Wagner

Recommended Posts

Hello,
 
I am trying to query my mysql database to return data based on a date range set.
 
here is the code that is returning an empty set.
 
The format is accepeted but will never return anything. Any help would be greatly appreciated.

SELECT * FROM (SELECT * FROM Live_Data WHERE uid='1' 'Post_Date' >= \"2013-11-21\" AND 'Post_Date' <= \"2013-11-22\" ORDER BY id DESC) tmp ORDER BY tmp.id ASC


or 



SELECT * FROM (SELECT * FROM Live_Data WHERE uid='$uid' 'Post_Date' BETWEEN '2013-11-21' AND '2013-11-22' ORDER BY id DESC) tmp ORDER BY tmp.id ASC
Link to comment
https://forums.phpfreaks.com/topic/284274-handling-dates-in-mysql-between-and/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.