Formatted dates query

sconly

Registered User.
Local time
Today, 21:35
Joined
Oct 8, 2002
Messages
56
How can i return data, which has a date formatted as 'mmm', which fall after the current month?

For example;
me 12/apr/09
them 09/apr/09
you 24/mar/09
it 07/may/09

from the data above i only want to bring back me, them and it.

Ta.
 
Are you just looking for those dates after today, or just where the month is greater than this month, regardless of year?
 
For now its just greater than this month, but when we get to towards the end of the year then it could be month and year.
 
To get anything with the date after this month

SELECT YOURTEXT
FROM YOURTABLE
WHERE MONTH(YOURDATE)>MONTH(NOW())

But that would show data from previous years also. Don't know if that matters to you or not.

If you need to see this year and future years, then:

SELECT YOURTEXT
FROM YOURTABLE
WHERE MONTH(YOURDATE)>MONTH(NOW())
AND YEAR(YOURDATE)>=YEAR(NOW())
 

Users who are viewing this thread

Back
Top Bottom