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

How to update an access field w/the date everytime a change is made to its row?
Is Access's AutoNumber (Increment) guaranteed to increment?
VBA Code to Count all Columns that are numeric in ListBox containing SQL Query Results
How to requery a subform from another form?
Is it possible to create a recursive query in Access?
MS Access 2000 Report needs to be PDF format with URL hyperlinks
Deploying Access as a client-server application
Resize form based on if subform visible
MS Access search for record by textbox instead of dropdown
Uniqueness Constraints in MS Access
Application Icon path in MS Access
Microsoft access is a mere file or data-base server
Is ACE/Jet's IN operator or CHECK constraint 'broken'?
Form.CurrentRecord=1 and Form.RecordSet.Absoluteposition=-1
email using Access and VBA without MAPI
MS Access Properties

Categories

HOME
java
compiler-construction
log4j
date
server
iterator
hashmap
fme
grep
kalman-filter
infragistics
gps
mvvmcross
applepay
dacpac
here-api
nstableview
windows-phone-7
tostring
ab-testing
normalizr
textfield
custom-wordpress-pages
nas
tar
csrf-protection
chromium-embedded
claims-based-identity
chromebook
info.plist
tooltipster
vision
c++-amp
delicious-api
react-chartjs
google-qpx-express-api
hexo
suricata
ws-security
acoustics
websphere-mq-fte
flickr-api
youcompleteme
apache-fop
theming
jquery-validate
worksheet
blogengine.net
sqlclient
sybase-asa
capacity
flow-control
synchronous
intrusion-detection
login-control
simplewebrtc
sigabrt
itextpdf
associative-array
ford-fulkerson
lemon
sdhc
kcachegrind
tarjans-algorithm
angular-leaflet-directive
service-accounts
remobjects
javax.mail
kineticjs
clicktag
c3
jscript.net
codeigniter-url
phalanger
xcode-6.2
navigationservice
reactfx
html5-notifications
multiprocessor
mysqltuner
farseer
batterylevel
sqlperformance
sharp-repository
android-hardware
specification-pattern
datawindow
uiviewanimation-curve
work-stealing
gnu-prolog
stage
qt-jambi
subgurim-maps
h.323
sortable-tables
castle-monorail
port-number
mdac
signal-handling

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