be33
be33

Reputation: 21

Inserting DATA in MS Access

I've this code: SELECT VISA41717.Fraud_Post_Date, VISA41717.Merchant_Name_Raw, VISA41717.Merchant_City, VISA41717.Merchant_Country, VISA41717.Merchant_Category_Code, VISA41717.ARN, VISA41717.POS_Entry_Mode, VISA41717.Fraud_Type, VISA41717.Local_Amt, VISA41717.Fraud_Amt, VISA41717.Purch_Date, VISA41717.Currency_Code, VISA41717.Cashback_Indicator, VISA41717.Card_Account_Num FROM VISA41717 LEFT JOIN MASTERCARD_VISA ON VISA41717.ARN=MASTERCARD_VISA.MICROFILM_NUMBER WHERE VISA41717.ARN IS NULL OR MASTERCARD_VISA.MICROFILM_NUMBER IS NULL ORDER BY VISA41717.ARN;

this is really works, But I need to match the first 6 digit of VISA41717.Card_Account_Num from BIN.INT to get the other data from BIN table and combined it all in one table only.

it should be this way:

sample output

Can you help me with this. thanks!

Upvotes: 1

Views: 32

Answers (1)

June7
June7

Reputation: 21389

What do you mean by 'all in one table'? Just build a query that joins tables.

Try:

SELECT ... FROM VISA41717 RIGHT JOIN BIN ON Left(VISA41717.Card_Account_Num, 6) = Bin.Int ...

Won't be able to build this join in Design View, use SQL View. Or build a query object that creates a field by extraction of the 6 characters and then build another query that includes that query and MASTERCARD_VISA and BIN tables.

Upvotes: 1

Related Questions