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.
| Author |
Topic |
|
sypher0011
Starting Member
2 Posts |
Posted - 2012-10-19 : 21:49:12
|
| Hello and Thanks in advance for any helpI'm looking for SQL query commands to find invoices that have conflicting informationWhat 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 correctDoes 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 MVPhttp://visakhm.blogspot.com/ |
 |
|
|
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 matchWhat 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. |
 |
|
|
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 matchWhat 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 wINNER JOIN custdocdata cON c.accountnames = w.accountnamesWHERE c.accountno <> w.accountno ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|