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:
Expand|Select|Wrap|Line Numbers
- 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:
Expand|Select|Wrap|Line Numbers
- 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.
Expand|Select|Wrap|Line Numbers
- SELECT custID, CustMoreThanMob
- FROM NotMobile OUTER RIGHT JOIN tblPhone ON NotMobile.CustMoreThanMob = tblPhone.c_uid
- WHERE CustMoreThanMob Is Null;
Thank You in Advance