Buy Support
Incidents |
If you can't find your answer
in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us
private or confidential information: |
Click Here
|
If you can't
login and post questions or you are having trouble viewing forum posts:
Click Here
|
Callback
Support |
If you live in USA, UK, Canada, Australia or New
Zealand, you can leave us details on your question and request us to call you back and discuss
them with you personally (charges apply). |
Click Here
|
Buy Support
Incidents |
If you can't find your answer
in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us
private or confidential information: |
Click Here
|
|
sp_reports or QODBC SQL query |
Author |
Message |
|
Posted : 2007-05-23 00:42:40 |
We are trying to do a variance based on salesrep's montly sales from last year (April for example), by salesrep, state and name with what they have sold for April of this year. I am at a point right now using QODBC SQL query and/or sp_reporting has left me floundering around so I'm not really sure of where to start. We'd like to total, if possible, each of the salesreps for the month in question by rep, state and name, and compare it with what they have done this year for the same month. Once this is figured out the actual variance math will be quite simple. Does this make sense? Basically, I need some kind of starting point.
We are running Quickbooks Enterprise, Manufacturing and Wholesale 7.0. |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2007-05-25 13:29:49 |
Well I would start by running the following queries as either an MS Access append query or within an Excel spreedsheet, total the values and compare them:
sp_report SalesByItemDetail show SalesRep, Text, Blank, TxnType, Date, RefNumber, Memo, Name, Quantity, UnitPrice, Amount, RunningBalance parameters DateFrom = {d '2006-04-01'}, DateTo = {d '2006-04-01'} where RowType='DataRow' and SalesRep='SaleRepName' order by SalesRep, NameState, Name
sp_report SalesByItemDetail show SalesRep, Text, Blank, TxnType, Date, RefNumber, Memo, Name, Quantity, UnitPrice, Amount, RunningBalance parameters DateFrom = {d '2007-04-01'}, DateTo = {d '2007-04-01'} where RowType='DataRow' and SalesRep='SaleRepName' order by SalesRep, NameState, Name
|
|
|
|
|
Posted : 2007-05-25 20:54:11 |
The headers return fine, but no information comes up. Also is there any way to sum(quantity) for the month by Name? We also need to "filter" out such things as SHIPPING, HANDLING, COMMENT, COMMENT1, COMMENT3, DISCOUNT, NULL. These "words" are entered in as "items" on the Sales Orders and need to be filtered, otherwise they come up as part of the sum(quantity) when, for example, "select shipaddressaddr1, sum(salesorderlineamount) as sumoftotalamount from salesorderline where (((txndate) >={d'2006-04-01'})) and (((salesorderline.txndate)<={d'2006-04-30'})) group by shipaddressaddr1" is used.
If this were a true SQL several sums could be used. This is a major problem for us as sales analysis has not been done since we've gone to Quickbooks. Thanks. |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2007-05-26 09:38:23 |
You can't use groups in our stored procedure reports but you can use it on normal SELECT statements, try working from this angle to get to your Sales Rep info instead and add the totals as required :-
SELECT Invoice.SalesRepRefFullName as "Rep", ReceivePaymentLine.TxnDate as "Date", Invoice.CustomerRefFullName as "Job",ReceivePaymentLine.AppliedToTxnRefNumber as "Inv No.", Invoice.SubTotal as "Orig. Amt.", ReceivePaymentLine.AppliedToTxnDiscountAmount as "Discount", ReceivePaymentLine.AppliedToTxnAmount as "Payment" FROM ReceivePaymentLine, Invoice where ReceivePaymentLine.AppliedToTxnTxnID= Invoice.TxnID and (ReceivePaymentLine.TxnDate >= {d '2006-06-01'} and ReceivePaymentLine.TxnDate < {d '2008-07-01'}) Order by Invoice.SalesRepRefFullName, Invoice.CustomerRefFullName
See also: How can I see the cost of a stock item and compare it to what I invoiced it for? |
|
|
|
|