Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

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

Forum : Cost AmountSearch Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC v6 Forum

 New Topic 
 
 Post Reply 
[1]  
 Cost Amount 
 Author   Message 
  MacTorvald 
  
 Group: Members 
 Posts: 29 
 Joined: 2007-08-22 
 Profile
 Posted : 2007-12-14 16:46:32
I need to find a way to calculate the cost amount of each invoice. I could not get this done yet because the purchase price is located on the inventory table and the quantity and invoice number is on the invoice line table. I did not find any relationship between these two tables to create a solution for my problem. Do you have any idea how could I solve this problem? 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-12-14 22:39:44
See: How can I see the cost of a stock item and compare it to what I invoiced it for?  

  Top 
  MacTorvald 
  
 Group: Members 
 Posts: 29 
 Joined: 2007-08-22 
 Profile
 Posted : 2007-12-15 06:50:54

Try:

select * from openquery(QODBC,'SELECT "Customer"."FullName", "InvoiceLine"."InvoiceLineItemRefFullName",

"InvoiceLine"."InvoiceLineQuantity", "InvoiceLine"."InvoiceLineDesc",

"InvoiceLine"."IsPaid", "InvoiceLine"."InvoiceLineAmount", "InvoiceLine"."InvoiceLineItemRefFullName", "InvoiceLine"."InvoiceLineClassRefFullName", "InvoiceLine"."InvoiceLineRate", "ItemInventory"."PurchaseCost", "ItemInventory"."AverageCost"

FROM "Customer" "Customer","InvoiceLine" "InvoiceLine", "ItemInventory" "ItemInventory"

WHERE ("InvoiceLine"."CustomerRefListID"="Customer"."ListID")

AND ("InvoiceLine"."InvoiceLineItemRefListID" = "ItemInventory"."ListID")')


Return:

Msg 492, Level 16, State 1, Line 1

Duplicate column names are not allowed in result sets obtained through OPENQUERY and OPENROWSET. The column name "InvoiceLineItemRefFullName" is a duplicate.

 

Help-me?

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-12-15 07:52:13

Try:

select * from openquery(QODBC, 'SELECT Customer.FullName, InvoiceLine.InvoiceLineItemRefFullName,
InvoiceLine.InvoiceLineQuantity, InvoiceLine.InvoiceLineDesc,
InvoiceLine.IsPaid, InvoiceLine.InvoiceLineAmount,
InvoiceLine.InvoiceLineItemRefFullName, InvoiceLine.InvoiceLineClassRefFullName,
InvoiceLine.InvoiceLineRate, ItemInventory.PurchaseCost, ItemInventory.AverageCost
FROM Customer, InvoiceLine, ItemInventory
WHERE InvoiceLine.CustomerRefListID=Customer.ListID
AND InvoiceLine.InvoiceLineItemRefListID = ItemInventory.ListID')

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to