Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Statement

Status
Not open for further replies.

tlmm

Programmer
Mar 25, 2004
45
0
0
CA
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.
 
Hi,

Open yout table.

Find a record with Primary Contact

COPY the value.

PASTE the value between the tic marks.

Skip,
[sub]
[glasses] [red]Be advised:[/red] Researchers have found another Descartes trueism, "Cogito ergo spud."
"I think; therefore, I YAM!
[tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top