01hanstu Posted March 13, 2012 Share Posted March 13, 2012 Hi, I have a table within my database named it_booking_ict1, ict2 etc and within each table it the following (cut down here) layouts, rows: start_week mon1 mon2 monclass1 monclass2 mon1changed mon2changed etc... 2012-03-12 00:00:00 FREE FREE NULL NULL 2012-03-13 NULL When a booking is made it updates the mon1 with the username, monclass1 with the class and adds the date to mon1changed. I am trying to make a select query that will show the bookings made for this week (staff can only book for the current week). I hope this makes sense, if anyone has any ideas i'd greatly appreciate it. Stu, Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted March 14, 2012 Share Posted March 14, 2012 select columns from table where date <= DATE_ADD( NOW(), INTERVAL 7 DAY ) this is assuming that you do not have dates in the past. Quote Link to comment Share on other sites More sharing options...
fenway Posted March 17, 2012 Share Posted March 17, 2012 I always prefer: select columns from table where date <= NOW() + INTERVAL 7 DAY Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.