Alias very useful

sSQLStatement = _ "SELECT Contacts.PostalName, Contacts.CompanyName, Addresses.Position, "+ _ "Addresses.Department, Addresses.Address1, Addresses.Address2, "+ _ "Addresses.Address3, Addresses.PostCode, Addresses.Town, Addresses.County, "+ _ "Addresses.Country, Contacts.ContactID, Transactions.DeliveryAddress " + _ "FROM Contacts JOIN Addresses ON Contacts.AddressID=Addresses.AddressID " + _ "JOIN Transactions ON Contacts.ContactID=Transactions.ContactID " + _ "WHERE Transactions.PaymentSecondRef LIKE '"+TBSNo+"' " + _ "AND Addresses.DefaultAddress = 1"
sSQLStatement = _ "SELECT Contacts.PostalName, Contacts.CompanyName, Addresses.Position, "+ _ "Addresses.Department, Addresses.Address1, Addresses.Address2, "+ _ "Addresses.Address3, Addresses.PostCode, Addresses.Town, Addresses.County, "+ _ "Addresses.Country, Contacts.ContactID, [b]Transation[/b].DeliveryAddress " + _ "FROM Contacts, Addresses,Transactions " _ & " WHERE contacts.AddressID=ADdresses.AddressID " _ & "and contacts.contactID=Transactions.contactID " _ & "and Transactions.PaymentSecondRef LIKE 'TBSNo'" _ & "and addresses.defaultAddress=1 "
sSQLStatement = _ "SELECT C.PostalName, C.CompanyName, A.Position, "+ _ "A.Department, A.Address1, A.Address2, "+ _ "A.Address3, A.PostCode, A.Town, A.County, "+ _ "A.Country, C.ContactID, T.DeliveryAddress " + _ "FROM Contacts C, Addresses A,Transactions T " _ & " WHERE c.AddressID=A.AddressID " _ & "and c.contactID=T.contactID " _ & "and T.PaymentSecondRef LIKE 'TBSNo'" _ & "and a.defaultAddress=1 "
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: