Hi Everyone,
I am new to SQL Server, but have played around with MS Access a fair bit.
I am currently trying to create an Outer Right Join on a Table and Query in SQL Server. Heres query from Access Query builder below:
Notes:
1. tblPhone is a Table and it contains the field CustID
2. NotMobile is a Query and it contains the field CustMoreThanMob
2.Heres the query that defines "NotMobile" in the above query:
I have tried to get the top query to run in SQL Server in the following ways:
1.
* Please note that all instances of the query "NotMobile" have been replaced by the words "NotMobile" . In the actaul query I have put the whole SQL String in round brackets.
Thank You in Advance
I am new to SQL Server, but have played around with MS Access a fair bit.
I am currently trying to create an Outer Right Join on a Table and Query in SQL Server. Heres query from Access Query builder below:
Code:
SELECT tblPhone.custID, NotMobile.CustMoreThanMob FROM NotMobile RIGHT JOIN tblPhone ON NotMobile.CustMoreThanMob = tblPhone.c_uid WHERE (((NotMobile.CustMoreThanMob) Is Null));
1. tblPhone is a Table and it contains the field CustID
2. NotMobile is a Query and it contains the field CustMoreThanMob
2.Heres the query that defines "NotMobile" in the above query:
Code:
SELECT Left([PhoneNumber],3) AS Type, tblPhone.custID AS CustMoreThanMob FROM tblPhone GROUP BY Left([PhoneNumber],3), tblPhone.custID HAVING (((Left([PhoneNumber],3))<>614));
1.
Code:
SELECT custID, CustMoreThanMob FROM NotMobile OUTER RIGHT JOIN tblPhone ON NotMobile.CustMoreThanMob = tblPhone.c_uid WHERE CustMoreThanMob Is Null;
Thank You in Advance
Comment