ms-access


MULTIPLE JOIN IN MS ACCESS


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,
BIN.BANK,
BIN.COUNTRY
FROM ((VISA41717 AS VS)
LEFT JOIN MASTERCARD_VISA AS MV ON VS.ARN = MV.MICROFILM_NUMBER)
RIGHT JOIN BIN AS B ON LEFT(Card_Account_Num, 6) = B.INT
WHERE VISA41717.ARN IS NULL
OR MASTERCARD_VISA.MICROFILM_NUMBER IS NULL
ORDER BY VISA41717.ARN;
I tried this code but give me an error
JOIN EXPRESSION NOT SUPPORTED
Then, I tried this one:
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,
BIN.BANK,
BIN.COUNTRY,
LEFT(Card_Account_Num, 6) AS VBIN
FROM VISA41717,
BIN
LEFT JOIN MASTERCARD_VISA ON (VISA41717.ARN = MASTERCARD_VISA.MICROFILM_NUMBER
AND VBIN = B.INT);
WHERE VISA41717.ARN IS NULL
OR MASTERCARD_VISA.MICROFILM_NUMBER IS NULL
ORDER BY VISA41717.ARN;
Still there's an error
SYNTAX ERROR IN JOIN OPERATOR
I'am trying to create a table from two different tables.
Thank you in advance.
When things get too convoluted, it might help to create a query that delivers the required fields:
SELECT *, LEFT(Card_Account_Num, 6) As Card_Account_Num6
FROM VISA41717
WHERE ARN IS NULL
Now you can use the query GUI designer with this query and table BIN as source.
Consider adding a LEFT JOIN to the query with tables relative to VISA41717 and even use the string expression directly in the ON clause which is viable in MS Access SQL though expressions with constants are not: ID=7.
However, with such expressions warnings may rise if you attempt to view the query in Design View (assuming you use the GUI program, MSAccess.exe). Do note the required parentheses pairings.
...
(FROM VISA41717
LEFT JOIN MASTERCARD_VISA
ON (VISA41717.ARN = MASTERCARD_VISA.MICROFILM_NUMBER))
LEFT JOIN [BIN]
ON (LEFT(VISA41717.Card_Account_Num, 6) = [BIN].[INT])

Related Links

Adding logic to a sub form in Access?
how to display specific records for editing in MS Access
creating more forms after exporting MS Access database
ms access - return records from sql Stored procedure
How to check if .Attachment.Add “filename” is successful before send
Access 2003 Select records with null time
Access: Shell cmd Open MDB
Append Records From Passthrough Query to Local Table
MS-Access library for performing many kinds of DDL operations on a database (to facilitate application version upgrades)?
How to Remove Stop Words from a string using Visual Basic?
Microsoft Access runtime error 2455 when trying to access grandchildren forms from child form
Microsoft Access - stored procedure with cursor
MS Access - Write to Table Immediately After Changing Value in Form
Unbind Access Project from source control
DAO access recordset not updating
No values given for one or more required parameters error only on some Windows 7 machines

Categories

HOME
magnific-popup
fme
read-eval-print-loop
filtering
react-redux
frameworks
jpeg
icloud
sql-server-2016
indesign
gorm
windows-10-universal
visual-studio-2005
quickfix
telephony
pc
undefined
excel-vba-mac
samoa
textfield
grails3
riot.js
orleans
blazemeter
linkerd
spring-mybatis
gsmcomm
media-queries
ecto
http-status-code-503
ioio
google-sites-2016
phpfreechat
gammu
host
overlap
appfabric
automake
hot-module-replacement
service-discovery
code-search-engine
awt
hp-ux
mapzen
reportingservices-2005
bootstrap-dialog
wptoolkit
logfiles
angular-resource
strptime
react-scripts
svmlight
nstextview
capacity
sqldf
objective-c-swift-bridge
thrust
ubuntu-10.04
hover-over
sdf
xpath-1.0
freelancer.com-api
rtbkit
lib.web.mvc
google-places
t4mvc
marching-cubes
rgeo
emailrelay
php-ci
cisco-ios
csquery
file-copying
wp-query
valueconverter
datagridviewcolumn
batterylevel
hungarian-algorithm
jquery-mobile-dialog
jelly
quickdialog
gdata-api
jspinclude
ohm
xtype
netbeans-7.1
iphone-web-app
mysql-error-1005
routedevent
vc90
perfect-hash
libs
ctp4
pascal-fc

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App