Hi all...

I am a developing a website using a joomla.

I need to display a content but the should filter according to the date.

I need only display content which are in between current date and before 30 days.

my current mysql quary is

SELECT * FROM events WHERE published =1 ORDER BY start_date ASC

in the data base there are tow fields to store date which are start date and end date

the dates values are storing like follow

start_date = 2010-05-11 19:00:00

end_date = 2010-20-01 19:00:00

this format can not change and it should be keep this format

So my dear friends how I do this...please help me

Thank you all

Umanda Jayo Bandara

8 Years
Discussion Span
Last Post by qualitybrains

Use :

SELECT * FROM events where published =1 and date(start_date) between date(now()) and date_add(date(now()),interval 30 day) ORDER BY start_date ASC

Hope it helps !

Edited by qualitybrains: Code Correction

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.