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 Select giving Error 1

Status
Not open for further replies.

MichHart

Programmer
Dec 14, 2002
56
0
0
CA
Hi eveyrone:

I have this Select statement that is giving me an error

"missing ).], or item in query expression"

Here is the statement:

Set rs = db.Execute("SELECT * " & " FROM DraftDetails WHERE DraftDetails.[Player] IN (SELECT Players.[Index]" & " from Players where Players.[FirstName] = " & strFN & " and Players.[LastName] = " & strLN)

Can someone tell me what is wrong with this statement???
I am going crossed eyed!!

MichHart " Never regret yesterday because it cannot be changed;
Instead make sure today does not become a regret of tomorrow."
 
Hi MichHart!

You forgot to close the parentheses of the subquery:

Set rs = db.Execute("SELECT * " & " FROM DraftDetails WHERE DraftDetails.[Player] IN (SELECT Players.[Index]" & " from Players where Players.[FirstName] = " & strFN & " and Players.[LastName] = " & strLN & ")")

hth
Jeff Bridgham
bridgham@purdue.edu
 
Thank you so much, it was starting to drive me crazy!!! lol

Sometimes a second set of eyes is all you need!

Thanks
MichHart " Never regret yesterday because it cannot be changed;
Instead make sure today does not become a regret of tomorrow."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top