Jump to content

Need a basic report


wss4a

Recommended Posts

Hello Everyone,

 

New to this forum and hope someone can help. I did try asking support and was willing to pay for an easy query. They're not providing paid services anymore.

 

This is what I need. I need to join the clients table with the products table. I need a report that provides me

the names of all of our plans (would be nice to have the price of the recurring fee of that plan) with how many clients are on that plan that are active.

 

I started writing a query to get this information, but I don't know the the table structures to join them together. I realize that the client id is different from the plan id and the clientid is not primary.

 

SELECT tblclients.status; tblproducts.name; Count (*)

FROM tblclients Left Join tblproducts On tblclients.ID = tblproducts.ID

WHERE Status = Active

 

Could someone help me out?

 

Thank you,

 

Steve

Link to comment
Share on other sites

SELECT t1.name, COUNT(t2.userid) AS clients, t3.monthly, t3.quarterly, t3.semiannually, t3.biennially, t3.triennially FROM tblproducts AS t1 LEFT JOIN tblhosting AS t2 ON t1.id = t2.packageid LEFT JOIN tblpricing AS t3 ON t1.id = t3.relid WHERE t2.domainstatus = 'Active' GROUP BY t1.id

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated