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
 Finding conflicting information

Author  Topic 

sypher0011
Starting Member

2 Posts

Posted - 2012-10-19 : 21:49:12
Hello and Thanks in advance for any help

I'm looking for SQL query commands to find invoices that have conflicting information

What I would like to do is look for the account number and account name from one table and then look at the invoices to see if they correct

Does anyone have any suggestions?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-10-19 : 22:19:04
how do you determine if they're correct? what are valid account rules?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

sypher0011
Starting Member

2 Posts

Posted - 2012-10-19 : 22:28:24
The valid rules would be account number and account names from table custdocdata, Then i would like to take that info and compare it to wodetail (invoices) which also has fields account number and account names ) and return all that don't match

What i have is a invoice showing the wrong account number but right account name on it and i need to see if there is more.

I really appreciate your help.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-10-19 : 22:51:48
quote:
Originally posted by sypher0011

The valid rules would be account number and account names from table custdocdata, Then i would like to take that info and compare it to wodetail (invoices) which also has fields account number and account names ) and return all that don't match

What i have is a invoice showing the wrong account number but right account name on it and i need to see if there is more.

I really appreciate your help.


I dont know how accurate are you account names. More often than not matching on text field is not found to be reliable.


SELECT w.*
FROM wodetail w
INNER JOIN custdocdata c
ON c.accountnames = w.accountnames
WHERE c.accountno <> w.accountno


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -