Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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 '14 at 13:32

Your Answer


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.