Can´t figure this one out...
I have a table (MySQL table) with a DATE field.
Now, I want to get all entries say for july (month 7)...
How shall I put this in my SQL question?
select * from mytable where ?????.....
SELECT * from table where month(datefield) = 7;
month(datefield) will return the NUMBER of the month. 7 for July, 8 for August, etc.
-- Jason
Thanks!
But what if I need the Year or the day= I tried this but I get an error...
SELECT * FROM mytable WHERE year(date)=$y AND month(date)=$m AND day(date)=$d"
Why is that? I susspect something to be wrong with the day(date) thing...
thanks for all help!
/F
Sorry.... I found the answer myself... But thanks for all the help!
🙂