I seem to be missing something fundamental. I an a new refugee from an old esoteric French database system (4D) and Im new to mySQL.
Given The following DB:
CREATE TABLE `stuff` (
`ID` INT NOT NULL AUTO_INCREMENT ,
`Product` VARCHAR(45) NULL ,
`Sell_by` DATE NULL ,
PRIMARY KEY (`ID`) );
INSERT INTO `Stuff` (`Product`, `Sell_by`) VALUES ('Milk', '2013-05-16');
INSERT INTO `Stuff` (`Product`, `Sell_by`) VALUES ('Cheese', '2013-06-15');
INSERT INTO `Stuff` (`Product`, `Sell_by`) VALUES ('Yogurt', '2013-07-02');
INSERT INTO `Stuff` (`Product`, `Sell_by`) VALUES ('Bread', '2013-08-17');
INSERT INTO `Stuff` (`Product`, `Sell_by`) VALUES ('Twinkies', '2099-04-16');
http://sqlfiddle.com/#!2/3ef48e/1
Why doesn't this return Milk Cheese and Yogurt? It returns nothing.
SELECT * FROM Stuff Where Sell_by <= 2013-07-04;
But this returns everything?
SELECT * FROM Stuff Where Sell_by >= 2013-07-04;