madsovenielsen Posted March 6, 2010 Share Posted March 6, 2010 Hey. i have this SQL sentence, but its not working, what am i doing wrong ? SELECT COUNT(DISTINCT remote_addr) amount FROM stat80 WHERE entry < 01-01-2010 00:00 /mads Link to comment Share on other sites More sharing options...
boen_robot Posted March 6, 2010 Share Posted March 6, 2010 What kind of an error does it give? Is "entry" of type DATETIME (I'm guessing "yes", but am asking anyways)? Is "amount" another column in the "stat80" table?For that last two ones, if yes, then I think the query should be: SELECT COUNT(DISTINCT remote_addr), amount FROM stat80 WHERE entry < '01-01-2010 00:00' (note the apostrophes around the date and the comma that separates the two result set columns) Link to comment Share on other sites More sharing options...
madsovenielsen Posted March 6, 2010 Author Share Posted March 6, 2010 What kind of an error does it give? Is "entry" of type DATETIME (I'm guessing "yes", but am asking anyways)? Is "amount" another column in the "stat80" table?For that last two ones, if yes, then I think the query should be:SELECT COUNT(DISTINCT remote_addr), amount FROM stat80 WHERE entry < '01-01-2010 00:00' (note the apostrophes around the date and the comma that separates the two result set columns) Yes and yesit works now, thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.