954,560 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

query help date time

Hello there,

I need some help with a query ..

Table

gamedate cutofftime
2011-08-25 13:55

I want to list games that are today +7 days but today games where the cutoff time has passed should not be displayed.

Can anyone help me with this query please.

Thank you for any help.

Peter

ppohlmann
Newbie Poster
12 posts since Nov 2010
Reputation Points: 10
Solved Threads: 0
 

lets see the query that you are working on.

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 

Query is below .. but it is "phped" ..

$query= "SELECT * FROM usrteams JOIN games ON (trim(usrteams.team)=trim(games.home) or trim(usrteams.team)=trim(games.visitor )) where usrteams.usrid='".$Userid."' and '".$elcurrenttime."' <=
games.cutofftime and games.gamedate='".$todaydate."' and games.gamedate >='".$todaydate."' and games.league='".$receivedleague."' order by games.gamedate asc limit 0,1 " or die(mysql_error())

ppohlmann
Newbie Poster
12 posts since Nov 2010
Reputation Points: 10
Solved Threads: 0
 

Maybe that makes more sense.. but it does not deliver the game listing..

SELECT * FROM usrteams JOIN games ON (trim(usrteams.team)=trim(games.home) or trim(usrteams.team)=trim(games.visitor )) where usrteams.usrid='10' AND games.gamedate >'2011-08-22' AND ('2011-08-22 20:14:58' < (SELECT CONCAT( games.gamedate, ' ', games.cutofftime ) FROM games where usrteams.usrid='10' and games.league='MLB' limit 1 )) AND games.league='MLB' order by games.gamedate asc limit 0,2

ppohlmann
Newbie Poster
12 posts since Nov 2010
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: