on 10-14-2008 5:45 AM
Hi All,
How to set multiple conditions in a query CFL.
This is my Code :
oRs.DoQuery("Select * from [@PSSIT_CMSAMHDR] where U_CardCode = '" & oVenCodeTxt.Value & "'")
oCFL = oForm.ChooseFromLists.Item("SRLst")
oCFL.SetConditions(emptyCon)
oCons = oCFL.GetConditions()
For IntICount = 0 To oRs.RecordCount - 1
If IntICount = (oRs.RecordCount - 1) Then
oCon = oCons.Add()
oCon.Alias = "U_CardCode"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = oVenCodeTxt.Value
Else
oCon = oCons.Add()
oCon.Alias = "U_CardCode"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = oVenCodeTxt.Value
oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR
End If
oRs.MoveNext()
Next
oCFL.SetConditions(oCons)
I want to set another condition for status which should be 'open'. how should i achieve this.
Regards
Mohana
Hi Mohana,
if you want to Add condition on both if and else part means try this following code after oCon.CondVal on both if and else statements,
oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND
oCon = oCons.Add()
oCon.Alias = "U_status"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = "Open"
Regards,
Ganesh k
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.