SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
Apr 26, 2004, 17:59 #1
- Join Date
- Mar 2004
- Location
- Canada
- Posts
- 4
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
help with : equal to or less than
Hi I am trying to get the data to display that equals the current week and year and past weeks. I am able to display the current week/year's data but not past or future.
$sql="SELECT * FROM sign WHERE WEEK(DATE)=WEEK(NOW()) AND YEAR(DATE)=YEAR(NOW())";
this is my sql statement I tried putting the >= and <= just incase I was confused but no luck.
any ideas?
thanks
-
Apr 27, 2004, 00:35 #2
- Join Date
- Jan 2004
- Location
- Uppsala, sverige
- Posts
- 700
- Mentioned
- 2 Post(s)
- Tagged
- 1 Thread(s)
Past and current records
Code:SELECT * FROM sign WHERE ( WEEK(DATE) <= WEEK(NOW()) AND YEAR(DATE)=YEAR(NOW())) or year(date) < year(now())
Code:SELECT * FROM sign WHERE ( WEEK(DATE) > WEEK(NOW()) AND YEAR(DATE)=YEAR(NOW())) or year(date) >= year(now())
Code:select * from sign where date <= current_date
-
Apr 27, 2004, 04:58 #3
- Join Date
- Mar 2004
- Location
- Canada
- Posts
- 4
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
thanks
Ill try these after work, select from current date alone wont work because I want the data to appear for the whole week not just the day.
Bookmarks