Forum Moderators: coopster

Message Too Old, No Replies

date problem

I want to display dates in a calender after today

         

bono667

8:49 pm on Jun 20, 2003 (gmt 0)

10+ Year Member



I want to display dates in a calender after today.

in other words something like

SELECT * FROM calender WHERE date >= $today order by date asc

I just want to select all dates that come after todays date, I can get todays date but cant work this out.

Oh, and does ne1 know how to make the date into an english style date too? eg 06/09/2003 instead of 2003/09/06

mcc235

11:43 am on Jun 21, 2003 (gmt 0)

10+ Year Member



SELECT DATE_FORMAT(date,'%d/%m/%Y') FROM calender WHERE date >= NOW() ORDER BY date ASC;

See the manual [mysql.com] for more info.

jatar_k

7:31 pm on Jun 21, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



by the way

Welcome to WebmasterWorld bono667

bono667

6:58 pm on Jun 28, 2003 (gmt 0)

10+ Year Member



thanks i found anouther post which explained all, but thanks for the help ne how

mcc235

6:05 am on Jun 29, 2003 (gmt 0)

10+ Year Member



bono667 what didn't you understand about the sql statement above? It does exactly what you asked for, selects all dates after today in the english format. Why did you need another post? Was there some other information that you also wanted, or didn't you understand the sql statement? It will help me to understand, for the next time I try and help someone.

Afkamm

3:35 pm on Jun 29, 2003 (gmt 0)

10+ Year Member



Do you need to add ASC at the end of the SQL statement?

Doesn't the output ascend automatically when it's not there? or is this just a case of keeping the code 'neat'?

Ta

Marc :-)

bono667

10:25 am on Jul 7, 2003 (gmt 0)

10+ Year Member



I found the post before your reply thats the reason i didnt need the help. Thankyou anyway.:-)

killroy

11:13 am on Jul 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you need a raw list of dates, rather then selectign records from a table based on their dates, you need a pivot table.

SN