Dear All, Am running an sql query in Access db , 2007 , and it returns the expected reocrds. Now i copied the same query into a dataset , but it is generating diff numnber of records. Any body can guide me where should i look to solve this. Am writing the query in case it helps :omg: SELECT tb_c.c_number, tb_c.c_description, tb_c.c_scope, tb_c.c_category, tb_c.c_type, tb_c.c_scope, tb_c.c_number, tb_e_to_c.total_dc, tb_e_to_c.e_id FROM tb_c INNER JOIN tb_e_to_c ON tb_c.c_number = tb_e_to_c.c_number WHERE (((tb_c.c_scope)="Base Scope") AND ((tb_e_to_c.e_id)=1)); And Here how i wrote in the data set (its runing and returning records, which means the syntes is true, but the numer of records are different): sqls = "SELECT tb_c.c_number, tb_c.c_description, tb_c.c_scope, tb_c.c_category, tb_c.c_type, tb_c.[c_scope], tb_c.[c_number], tb_e_to_c.total_dc, tb_e_to_c.e_id FROM tb_c INNER JOIN tb_e_to_c ON tb_c.c_number = tb_e_to_c.c_number WHERE(((tb_c.[c_scope])= '" & scope & "' AND ((tb_e_to_c.e_id)= " & eid & ")))" set rcs = db.openrecordset (sqls)
0 will always beats the 1.