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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 having trouble jointing two tables
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

6 Posts

Posted - 01/29/2013 :  17:23:53  Show Profile  Reply with Quote
I trying pull out a list of transaction that have codevalue = 98 and ddclang = S. I can not get a match because though values are on different lines in the a01c table.

SELECT * FROM dbo.T01_TransactionMaster t01 with (nolock), dbo.A01cAccountCodes a01c with (nolock)
WHERE T01.AccountNumber = A01c.AccountNumber and a01c.CodeType = 'ACCTSTATUS' and a01c.CodeValue = '98' and a01c.CodeType = 'DDCLANG' and a01c.CodeValue = 'S'

A01c.accountCodes table

RecordId Account# CodeType CodeValue

39232281 38761371 ACCTSTATUS 98
30549600 38761371 BROKERLIST COVHO2
821632 38761371 DDCGENDER F
1961185 38761371 DDCLANG S
1096315 38761371 DDCSRCCODE 10SN42N304

Flowing Fount of Yak Knowledge

4614 Posts

Posted - 01/29/2013 :  18:00:19  Show Profile  Reply with Quote
You need to give us more information. First and foremost, you didn’t even ask a question. But, how do the tables relate? Why are you not using ansi style joins? Is that "result set" the result you are receiving or the one you want? Perhaps some sample data to illustrate the issue?

Here are some links that can help guide you on to ask your question in a way that we can help you better:

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000