Avatar of jameskane
jameskane

asked on 

Using INNER JOIN query with coldfusion

I have two tables - each with a shared field name   memberID.

The members2 table gives info about members (name, address..) and has memberID a Key field.

The bank_cheque_listing table records transactions and has a memberID field - which is not a key field as memberID will reoccur whenever a member makes more than one transaction.

I need a query which will give me a listing of all transactions - each row of the listing containinng information about the nature of the transaction and also information about the member involved in the transaction.

I have tried creating a query using an INNER JOIN approach - but get an error reporting that no value was given for one or more parameters.

Can someone take a look at my query and tell me if I am on the right track here ?

Many thanks in advance;
<cfquery name="recordset_banklisting" datasource="Office">
 
SELECT 
bank_cheque_listing.cheque_paydate,
     bank_cheque_listing.cheque_value,
     bank_cheque_listing.cheque_bank,
     bank_cheque_listing.cheque_branch,
     bank_cheque_listing.cheque_number,
     bank_cheque_listing.cheque_ac_owner,
     bank_cheque_listing.cheque_status,
     MEMBERS2.memberID,
     members2.Nom,
     Members2.Prenom,
     members2.Addresse,
     members2.zip,
     members2.ville
     
FROM bank_cheque_listing
INNER JOIN members2
ON bank_cheque_listing.memberID = members2.memberID
ORDER BY bank_cheque_listing.cheque_paydate
 
 
</cfquery>

Open in new window

ColdFusion Language

Avatar of undefined
Last Comment
jameskane

8/22/2022 - Mon