Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Duplicate entries from Access query

Status
Not open for further replies.

BasicBoy

Programmer
Feb 22, 2008
156
ZA
I have this query:

ListQuery(35) = "Select transactions.id, transactions.transdate, journaltranstypes.transtype, transactions.description, transactions.refno, paidforvotes.votename as paidforvotename, amountdt, vatondt, format(vatamountdt,'currency'), paidbyvotes.votename as paidbyvotename, amountcr, vatoncr, format(vatamountcr,'currency'), tasks.taskname, transactions.reconciled, transactions.enteredby from (((Transactions LEFT JOIN Votes as paidforvotes ON Transactions.paidfor=paidforVotes.voteno) LEFT JOIN Votes as paidbyvotes ON Transactions.paidby=paidbyVotes.voteno) LEFT JOIN journaltranstypes on transactions.transtype=journaltranstypes.id) left join tasks on tasks.id=transactions.taskno"

There are only three entries in the database but I get 5 records, some of them with duplicate ID numbers.
My Access ID is a long number which is the key and there are no duplicate records in the database.

Can someone please help.

Many thanks
 
How many related records do you have in Transactions, Votes, journaltranstypes, and tasks tables?

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
As I understand your question.
I select from TRANSACTIONS which have fields for journaltranstypes (as in integer to be joiend from that table) selected from a dropdownbox, TaskNo which is adding one specific task to one specific transaction (to be added by selecting one task items from many tasks and adding the ID for that taskitem as TaskNo), and the two vote fields just add one debit and one credit vote for every transaction.
Hope it helps
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top