Using MySQL syntax and having a table with a row like:
mydate DATETIME NULL,
Is there a way to do something like:
... WHERE mydate<='2008-11-25';
I'm trying but not really getting it to work.
Uh, WHERE mydate<='2008-11-25'
is the way to do it. That should work.
Do you get an error message? Are you using an ancient version of MySQL?
Edit: The following works fine for me on MySQL 5.x
create temporary table foo(d datetime);
insert into foo(d) VALUES ('2000-01-01');
insert into foo(d) VALUES ('2001-01-01');
select * from foo where d <= '2000-06-01';
Nevermind found an answer. Ty the same for anyone who was willing to reply.
WHERE DATEDIFF(mydata,'2008-11-20') >=0;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With