form datasources join

Hello Friends,

in InventJournal Loss Profit Form which contains datasources(Invent journalTrans , inventdim) … i need to add new datasource(like InventLoc) now i am trying to write add link method in my datasource (Execute Query method)in that i need to link

inventdim.inventlocationid == inventloc.inventlocationid &&

inventjournalTrans. itemid == inventloc.itemid

how can i achieve this please help me out