Hi,
here is some answer to your first question: "toatal due query: I got some great help on the forum to create my total due query. However it produces it with just total due, how could i have it by month?"
Answer (code not tested):
You can apply aggregate functions such as sum(), min(), avg() etc together with expressions or simple attributes of a table. For example, if you want to group various amounts by the month they accrued from together with the monthly subtotal you should code:
select monthname(datePaid) as Mois, sum(amount) as monthly_Mortgage from mortgage
where DatePaid IS NULL group by Mois;
Output could look like:
Mois_________monthly_Mortgage
January______3,541.58
February_______999.87
etc.
Important rule: All attributes appearing in the select statement which are not part of an aggregate function must be specified in the group-by clause, e.g.
select a, b, c, avg(d), min(e) from x where... group by a, b, c; -- correct clause
select a, b, avg(d), min(e) from x where... group by a; -- wrong clause, missing attribute b
(consider, there are about 30 useful aggregate functions)
Maybe you will get inspired by this group-by clause how to solve "I would like to show the users name along with the clients name in the query."? I'll noddle over this soon, and will be answering asap. To solve this task several tables must be joined together: referrals inner join clients inner join users, where "referrals" surrogates further tables.
…