Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If..Then with multiple criteria 1

Status
Not open for further replies.

cabbey77

Technical User
Aug 6, 2004
68
US
I read that ReportBasic is not Boolean, so how would I go about something to this effect:

If Field A = X and Field B = Y Then
D = Z
Else if Field A = X and Field B = Z then
D = Q
 
If you're doing a macro, you would write it like:

If Field$("A") = "X" and Field$("B") = "Y" Then
D = "Z"
Else
If Field$("A") = "X" and Field$("B") = "Z" Then
D = "Q"
Else
D = "No value"
End if
DerivedField(D)

I find it easier to either do a decode or case statement using a derived field. Macros tend to slow down you querie and macros are alway after the fact. Not to mention, if you're using numbers with this querie you would have to seperately write a SUM field to calculate SUMS or COUNTS - and you can't even group or sort on macros.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top