Hi I hope someone can point me in the right direction:
In our office we are running a PHP + Mysql system which runs over the internal domain.
It is an insurance issuing system handling renewals, new business certificates etc etc
We are building a website where our clients can renew their...
The query is used to populate a report, to list an employees commission they have earnt on each case of new business they have made.
The rows lest each client's name, type of product they have sold and commission earnt from that sale. At the bottom of the commission earnt column I just need a...
Well I seem to be doing what you have said Leslie, but the total field is still not calculating all of the fields:
SELECT LOG.[Advisor], LOG.[Date Business Written], LOG.[Clients Name], LOG.[Business Written?], LOG.[Single or Annual], LOG.[Type of Policy], LOG.[Premium Paid], LOG.[JBI...
So are you saying that because a date field is present that it supercedes the request to sum my commission field?
My other fields are mainly text fields and a couple of currency fields.
Will
Ok I have now added sum(LOG.[Your Commission]) AS sum to my query.
The query returns a result set like this:
name | other fields | commission | sum
-------------------------------------------------
smith | other results | £11.00 | £11.00
joy | other results | £4.00 | £4.00
Doyle...
Ok I've had a shot and am getting the error message: You tried to execute a query that doesn't include the specified expression 'Advisor' as part of an aggregate function."
SELECT LOG.[Advisor], LOG.[Date Business Written], LOG.[Clients Name], LOG.[Business Written?], LOG.[Single or Annual]...
Hmm you maybe right
Maybe i spoke too soon.
The sum function is not working properly. I now there are more than one result in the set as my report lists them however them sum is not adding them all up. It looks as if its just displaying one of the values in the list!
Any suggestions?
thanks for your reply, have just sussed it. Thanks though.
SELECT LOG.[Advisor], LOG.[Date Business Written], LOG.[Clients Name], LOG.[Business Written?], LOG.[Single or Annual], LOG.[Type of Policy], LOG.[Premium Paid], LOG.[JBI Commission], LOG.[Your Commission], Advisors.[Full Name]...
Ok so I need 'GROUP BY'.
IT4EVR can you do one of your nice little guides for GROUP BY like you just did for INNER JOIN?
Thanks for the quick replies.
Will
Hi there
I am getting really stuck on this SQL query. I have just added SUM() to it and realise I need to change it to an INNER JOIN query but having on where to start!!
Any help will be appreciated, thanks:
SELECT LOG.[Advisor], LOG.[Date Business Written], LOG.[Clients Name], LOG.[Business...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.