Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Query help

Author  Topic 

goodmachine
Starting Member

1 Post

Posted - 2008-12-17 : 14:14:32
I'm trying to create a query that will pull data for paid invoices that are higher than 5% the purchase order line amount (greater than $1000). The data I'm receiving is not pulling all of the data that I want. In some cases, the invoice amounts are = to the purchase order amount.

Any suggestions are appreciated.

Select Distinct UniqueName,StatusString,TimeCreated AS OrderDate,Name as Title,LineItems.Supplier.Name AS Supplier, LineItems.Description.Description AS LineDescription,LineItems.Accountings.SplitAccountings.Department.DepartmentId AS Cost_Center,LineItems.Accountings.SplitAccountings.Account.UniqueName AS GL_Account,LineItems.Amount, "Order".LineItems.Amount from InvoiceReconciliation where YEAR(CreateDate) = 2008 AND MONTH(CreateDate) IN (7,8,9) AND (AmountInvoiced.Amount
> "Order".LineItems.Amount.Amount * 1.1) AND LineItems.Amount.Amount >= 1000

Thanks,

SB

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-17 : 23:28:03
cai you post some sample data and explan your scenario. that would be easier than looking into query
Go to Top of Page
   

- Advertisement -