Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
SELECT tbl_HouseholdApplication.NameLast,tbl_HouseholdApplication.Address,
WHERE (((tbl_HouseholdApplication.Address)=[What is the Street Address?]))
ORDER BY tbl_HouseholdApplication.NameLast, tbl_HouseholdApplication.Address;

What I have tried:

WHERE tbl_HouseholdApplication.Address<pre>

ORDER BY tbl_HouseholdApplication.Address
Posted
Updated 4-May-23 9:25am
v2
Comments
Richard MacCutchan 4-May-23 12:49pm    
You have coded one pair of parentheses too many (I guess). But your question is not very clear.

Square brackets don't delimit strings, they delimit names that contain illegal characters (like spaces)

So if you are trying to compare a column with a string, you need to replace the "[" and "]" characters around it with quotes:
SQL
'What is the Street Address?'


You also need to remove the spurious trailing comma in the SELECT list:
SQL
SELECT tbl_HouseholdApplication.NameLast,tbl_HouseholdApplication.Address,
                                                                         ^
                                                                         |
WHERE (((tbl_HouseholdApplication.Address)=[What is the Street Address?]))
ORDER BY tbl_HouseholdApplication.NameLast, tbl_HouseholdApplication.Address;
SQL doesn't like them!

It may be ugly, but it's better to use leading commas rather than trailing.
 
Share this answer
 
Comments
Jack Moore 2023 4-May-23 15:14pm    
Now I get:

Syntax error (missing operator0 in query expression 'tbl_HouseholdApplication.Address
WHERE (((tbl_HouseholdApplication.Address)=[What is the Street Address?]))
ORDER By tbl_HouseholdApplication.NameLast
OriginalGriff 5-May-23 0:50am    
And do you have a column called "What is the Street Address?"
Syntax error (missing operator0 in query expression 'tbl_HouseholdApplication.Address
WHERE (((tbl_HouseholdApplication.Address)=[What is the Street Address?]))
ORDER By tbl_HouseholdApplication.NameLast
 
Share this answer
 
v3
Comments
CHill60 5-May-23 3:55am    
This is not a solution. Use "Improve Question" link to update your question.
You have missed the SELECT from the query which is why you are getting this error. Plus, if you don't actually have a column called [What is the Street Address?] then you need to use 'What is the Street Address?' - read Solution 1

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900