List:General Discussion« Previous MessageNext Message »
From:John Meyer Date:September 16 2009 7:51pm
Subject:Datediff function
View as plain text  
I'm trying to pull up a list of users who haven't tweeted in 7 or more 
days, and I'm trying to use this statement:
SELECT USER_NAME, MAX(TWEET_CREATEDAT) FROM USERS NATURAL JOIN TWEETS 
WHERE DATEDIFF(NOW(),MAX(TWEET_CREATEDAT)) > 7 GROUP BY USERS.USER_ID

But it says "invalid group function".  How should I reword this query?
Thread
Datediff functionJohn Meyer16 Sep
  • RE: Datediff functionGavin Towey17 Sep
    • Re: Datediff functionJohn Meyer17 Sep
      • RE: Datediff functionGavin Towey17 Sep
    • RE: Datediff functionJerry Schwartz17 Sep
  • Re: Datediff functionShawn Green17 Sep