twister Posted August 1, 2023 Share Posted August 1, 2023 the issue presented is the following: i have 3 billing cycles used - monthly, quarterly, annually i need to make a report of active users per last 100 weeks and show it per each week. making the 100 weeks interval is not an issue, bash takes care of that. the problem is what pattern to follow: for e.g. this does not get me anywhere SELECT COUNT(*) AS WeekCount FROM tblclients JOIN tblhosting ON tblclients.id = tblhosting.userid WHERE tblhosting.regdate BETWEEN '2017-01-01' AND week_end_date AND tblhosting.packageid IN (1,4) AND tblhosting.domainstatus='Active' AND tblclients.id in (SELECT DISTINCT(tblinvoices.userid) as id from tblinvoices where tblinvoices.datepaid is not NULL) the result i get is an ascending progression instead of a declining one - which is the reality. 0 Quote Link to comment Share on other sites More sharing options...
twister Posted August 4, 2023 Author Share Posted August 4, 2023 @brian! any insights? you're the best here, maybe you can help. 0 Quote Link to comment Share on other sites More sharing options...
bear Posted August 4, 2023 Share Posted August 4, 2023 (edited) He left this board quite a while ago, so the odds of him responding are low, I'd say. For your issue, have you tried "order by" in the query? Edited August 4, 2023 by bear 0 Quote Link to comment Share on other sites More sharing options...
twister Posted August 7, 2023 Author Share Posted August 7, 2023 On 8/4/2023 at 9:03 PM, bear said: He left this board quite a while ago, so the odds of him responding are low, I'd say. For your issue, have you tried "order by" in the query? yeah, not giving the proper numbers, so sort doesn't help in this case. i feel like I'm missing smth on query. 0 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.