Microsoft
Software
Hardware
Network
Question : Date and time span in MySQL
Hi,
I have a filed in my database table called 'newsdate' which contains a unix time of when a news Item is added. I have categorized my menu into Months of a year, so when a user selects $month=4 and $year=2009, I want to enter these two variables into an SQL statement which will return all articles that where entered on the 4th Month of 2009 for example. Can anyone tell me how I may achieve this please?
Thank you in advance
Answer : Date and time span in MySQL
You can use MONTH() and YEAR() functions in MySQL, so
SELECT * FROM table WHERE MONTH(newsdate) = 4 AND YEAR(newsdate) = 2010
Random Solutions
Adobe - monitor profile [..] appears to be defective. Please rerun your monitor calibration software
Mail delivery has failed
WRT54G2 Linksys router - reset password saving actual configuration
How can I dynamically switch web service addresses in .NET without a recompile?
Net Use returns "System error 64 has occurred. The specified network name is no longer available."
Strip out ’s in mySQL query | XML Parsing Error: undefined entity
How to get lightbox to show over Flash banner?
Out of Office Assistant not working w/Forwarding Configured
Javascript to get <TD> inner text in MSIE, FF and Chrome
How do I use the Windows XP installation disc to replace missing system files?