dtyson2000 Posted January 20, 2013 Share Posted January 20, 2013 Hello all. I have this query: SELECT userid, namelast, namefirst, userpaid (SELECT COUNT(*) FROM login WHERE YEARWEEK(logindate) = YEARWEEK(CURDATE()) AND login.luserid = users.userid) AS wklogins, (SELECT COUNT(*) FROM login WHERE YEAR(logindate) = YEAR(CURDATE()) AND MONTH(logindate) = MONTH(CURDATE()) AND login.luserid = users.userid) AS mologins FROM users LEFT OUTER JOIN login ON users.userid = login.luserid AND !(login.logindate < CURDATE()) LEFT OUTER JOIN payments ON users.userid = payments.puserid WHERE ((DATE(login.logindate) != CURDATE()) || login.luserid IS NULL) && (users.userpaid = 'T') ORDER BY users.namelast, users.namefirst For some reason, which I can't seem to find, the joins don't seem to be happening. I definitely know that I'm getting the desired results from the primary and subqueries but I am not seeing anything joined to the resulting dataset. Do you see something wrong with this query? If you do, can you point me in the direction I need to go to fixing it? Thank you, in advance, for your help! Quote Link to comment Share on other sites More sharing options...
dtyson2000 Posted January 20, 2013 Author Share Posted January 20, 2013 Found it. Quote Link to comment Share on other sites More sharing options...
Barand Posted January 20, 2013 Share Posted January 20, 2013 So good of you to come here for help yet when you find the solution you aren't willing to share it 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.