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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Filtering on multiple parameters

Author  Topic 

gemini_shooter
Starting Member

12 Posts

Posted - 2010-01-24 : 01:15:16
Hello all,

I have the below sample G/L Entry Data:

My where condition is a little complicated for me and I don't know how to write this query:

Tans. No. Entry No_ G_L Account No_ Code 1 Code 2
1 337 51005 HOU
1 338 22550
2 22165 41005
2 22166 12000 LAMB
2 22160 42000
2 22161 12000
4 22168 14210
4 22169 12000



-- Condition 1 (Code 1 or Code 2 is Blank) OR Code 2 = <invalid value> OR Code 1 = <invalid value>
-- I need help with Condition 2 Per Transaction ID (I want to pull all the G L Accounts >= 4000 but I also want want to include rows with same transaction ID, these rows might have G L Account values < 40000)
-- Exclude Rows with G L Accounts <40000 per transaction ID

I am not sure if I was clear in explaning this, but based on sample above the last two rows should be dropped

Any help would be highly appreciated.
quote:

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-24 : 09:42:18
can you show your expected output out of above data?
Go to Top of Page
   

- Advertisement -