I have a sql statement in my code which pulls data from a specific table and looks for certain criteria. The criteria is a value in a field in my table which consists of 2 words. I am unsure of how to fix my statement to include this space.
This is the sql statement:
strSQL2 = "SELECT DISTINCT GroupMembershipName, ID FROM tblMembership WHERE (MemberContact = 'Primary Contact') ORDER BY GroupMembershipName;"
"Primary Contact" is what is causing me trouble. I tried changing the value in the table to a single word and using this in my statement, and it worked fine. So I'm assuming the problem is the space.
Can someone tell me how to fix this and incorporate the space into my sql statement?
Thanks.
This is the sql statement:
strSQL2 = "SELECT DISTINCT GroupMembershipName, ID FROM tblMembership WHERE (MemberContact = 'Primary Contact') ORDER BY GroupMembershipName;"
"Primary Contact" is what is causing me trouble. I tried changing the value in the table to a single word and using this in my statement, and it worked fine. So I'm assuming the problem is the space.
Can someone tell me how to fix this and incorporate the space into my sql statement?
Thanks.