select join three tables statement

hi, i am trying to get Description, DefTypeCodeID, and Quantity out of three tables in Axapta: TQMNCR, TQMDEFTYPECODES,TQMNCRDEFECTTYPECODES. Description and DefTypeCodeID are from TQMDEFTYPECODES, Quantity is from TQMNCRDEFECTTYPECODES. I am doing this in .Net. i dont know why it did not give me anything if i tried to join three tables. if i ran each statement separately in condition joining two tables then it gave me what i wanted, but when comes to three then it returned nothing. Would someone point out what i did wrong ? whats the syntax for joining three tables ?

rec1 = Axapta.CreateRecord(“TQMNCR”)

rec2 = Axapta.CreateRecord(“TQMDEFTYPECODES”)

rec3 = Axapta.CreateRecord(“TQMNCRDEFECTTYPECODES”)

sString = “SELECT * FROM %3 JOIN %1 WHERE %1.NCRID == %3.NCRID JOIN %2 WHERE %2.DEFTYPECODEID == %3.QUALITYDEFTYPECODEID”

Axapta.ExecuteStmt(sString, rec1, rec2, rec3)

Thanks in advance.

Wrong Forum, Please move to Axapta forum. /TH

please disregard. Thanks