Web Hosting Talk







View Full Version : MySQL date question.


E Versijp
04-16-2003, 10:11 AM
I have a page where I put up a training every week. We do these trainings every Wednesday. What I want is that I can already put the trainings several weeks in advance in the database but that they are shown on the webpage a week in advance. So, on Thursday the new training will be visible for next Wednesday.

Right now I already have several pages where articles are shown from the date that is set in the database. I do that with the following MySQL:

WHERE TO_DAYS(NOW()) >= TO_DAYS(date)

Can anybody change this for me into a statement where the data is shown 6 days before the date in the date column.

Thanks in advance.

vendor
04-16-2003, 11:02 AM
Actualy I never used MySQL I'm MSSQL programer

But IMHO WHERE clause should be like

WHERE TO_DAYS(NOW()) >= TO_DAYS(date)-6

or

WHERE TO_DAYS(NOW())+6 >= TO_DAYS(date)