I have SQL Statement for a query:
SELECT Trim([p_name]) & IIf([p_name]<>""," " & Trim([f_name]) & IIf([f_name]<>""," " & Trim([m_name]) & IIf([m_name]<>""," " & Trim([l_name]) & IIf([s_name]<>"",", " & Trim([s_name]) AS Expr1, tblContacts.company, tblContacts.title, tblContacts.tollfree, tblContacts.email, tblContacts.business_phone1, tblContacts.business_ext1, tblContacts.business_phone2, tblContacts.business_ext2, tblContacts.business_fax
FROM tblContacts;
I have done Dim stSQL as String
and
stSQL = "All the above statement"
But, it keeps giving me Expected end of statement and highlighting atea around quotations in the Trim part.
Any suggestions.
SELECT Trim([p_name]) & IIf([p_name]<>""," " & Trim([f_name]) & IIf([f_name]<>""," " & Trim([m_name]) & IIf([m_name]<>""," " & Trim([l_name]) & IIf([s_name]<>"",", " & Trim([s_name]) AS Expr1, tblContacts.company, tblContacts.title, tblContacts.tollfree, tblContacts.email, tblContacts.business_phone1, tblContacts.business_ext1, tblContacts.business_phone2, tblContacts.business_ext2, tblContacts.business_fax
FROM tblContacts;
I have done Dim stSQL as String
and
stSQL = "All the above statement"
But, it keeps giving me Expected end of statement and highlighting atea around quotations in the Trim part.
Any suggestions.