Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

In Ampscript, how does would you write multiple conditions in a IF statement. for example I want all conditions to be true in the IF statement

set @var1=0
set @var2=0
set @var3=1

if (@var1 == 0 && @var2==0 && @var3 == 0) then 

is this the correct way to do it in Ampscript?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Replace the && with AND. Also || is OR.

set @var1=0
set @var2=0
set @var3=1

if (@var1 == 0 AND @var2 == 0 AND @var3 == 0) then 
share|improve this answer
    
Yes, that works. Thanks –  Kam Feb 5 at 13:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.