- Home
- Anonymous
- Sign in
- Create
- Ask a question
- Spaces
- Site Issues (NOT FOR DATABASE QUESTIONS)
- Explore
- Topics
- Questions
- Users
- Badges

IF I consider 'PREVMNTPV' is one table and 'CURR' is other table and 'CURR' table consists of field1,field2,fied3 and field4. How do I get the below excel formaules to SQL. Please help me out... col1/field1=IF(T2="Inactive",0,IF(AND(ISNA(VLOOKUP($A2,'PREVMNTPV'!A:B,2,FALSE)),BL2=1),1,IF(ISNA(VLOOKUP($A2,'PREVMNTPV'!A:B,2,FALSE)),0,IF(AND(BL2=1,VLOOKUP($A2,'PREVMNTPV'!A:E,5,FALSE)="Inactive",T2="Active"),1,IF(ISNA(VLOOKUP($A2,'PREVMNTPV'!A:B,2,FALSE)),0,IF(AND(BL2=1,VLOOKUP($A2,'PREVMNTPV'!A:F,6,FALSE)=0),1,0)))))) col2/field2=IF(ISNA(VLOOKUP($A2,'PREVMNTPV'!A:B,2,FALSE)),0,IF(AND(T2="Inactive",VLOOKUP($A2,'PREVMNTPV'!A:K,6,FALSE)=1,VLOOKUP($A2,'PREVMNTPV'!A:E,5,FALSE)="Active"),-1,IF(AND(VLOOKUP($A2,'PREVMNTPV'!A:K,6,FALSE)=1,BL2=0,VLOOKUP($A2,'PREVMNTPV'!A:E,5,FALSE)="Inactive"),0,IF(AND(BL2=0,VLOOKUP($A2,'PREVMNTPV'!A:K,6,FALSE)=1),-1,0)))) col3/field3=IF(OR(T2="Inactive",DI2<0),0,IF(DG2=-1,0,IF(DF2=1,BT2,IF(ISNA(VLOOKUP(A2,'PREVMNTPV'!A:K,8,FALSE)),BT2,IF(AND(BL2=1,(VLOOKUP(A2,'PREVMNTPV'!A:K,8,FALSE)0),0,BT2-(VLOOKUP($A2,'PREVMNTPV'!A:K,8,FALSE)))))))

sqlexcel
Comment

**8** People are following this question.

Copyright 2022 Redgate Software.
Privacy Policy