title: AmpScript issue with IF Statement
body: <p>I am trying to do a lookup to two different data extensions in exact target using ampscript. Please find the sample code I am trying . </p>
  
  <pre><code>%%[
  Var @rows
  Set @rows=LookupRows("DataExtensionOne","Lead Owner","Nick")
  FOR @y = 1 TO RowCount(@rows) DO 
      Set @currentRow = Row(@rows,@y)    
      Set @value = FIELD(@currentRow ,"LeadId")
      Set @secondDERows = LookupRows("DataExtensionTwo","Gender","Male")
      FOR @x = 1 TO RowCount(@secondDERows) DO 
          Set @currentRowInSecDE = Row(@secondDERows,@x)    
          Set @secValue = FIELD(@currentRowInSecDE ,"LeadId")
          IF @value == @secValue THEN
              Set @FirstName = FIELD(@currentRowInSecDE ,"FirstName")
          /* Need to break out of the loop */
  ]%%
  </code></pre>
  
  <p>The If condition check seems to fail @value == @secValue .
  It doesnt fetch any value for the @FirstName. And what statement should be used to break out of IF loop ?</p>
  
  <p>Has anyone come across similar problems ? Please do let me know.</p>